diff options
author | Russell Belfer <rb@github.com> | 2014-03-25 12:37:05 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-03-25 12:37:05 -0700 |
commit | d3bc95fd664095a0c8dfcdf99f62741b1ecd6ffc (patch) | |
tree | e152a3bf6e448d04752821c17653357a2ae36688 /tests/submodule | |
parent | f210cb5b1442f82e2f930909d8430f7cc6661c5f (diff) | |
download | libgit2-d3bc95fd664095a0c8dfcdf99f62741b1ecd6ffc.tar.gz |
Update behavior for untracked sub-repos
When a directory containing a .git directory (or even just a plain
gitlink) was found, libgit2 was going out of its way to treat it
specially. This seemed like it was necessary because the diff
code was not originally emulating Git's behavior for untracked
directories correctly (i.e. scanning for ignored vs untracked items
inside). Now that libgit2 diff mimics Git's untracked directory
behavior, the special handling for contained Git repos is actually
incorrect and this commit rips it out.
Diffstat (limited to 'tests/submodule')
-rw-r--r-- | tests/submodule/status.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/tests/submodule/status.c b/tests/submodule/status.c index f5111c84f..324592301 100644 --- a/tests/submodule/status.c +++ b/tests/submodule/status.c @@ -324,7 +324,7 @@ static int confirm_submodule_status( { submodule_expectations *exp = payload; - while (git__suffixcmp(exp->paths[exp->counter], "/") == 0) + while (exp->statuses[exp->counter] < 0) exp->counter++; cl_assert_equal_i(exp->statuses[exp->counter], (int)status_flags); @@ -345,8 +345,10 @@ void test_submodule_status__iterator(void) "just_a_dir/", "just_a_dir/contents", "just_a_file", - "not", - "not-submodule", + "not-submodule/", + "not-submodule/README.txt", + "not/", + "not/README.txt", "README.txt", "sm_added_and_uncommited", "sm_changed_file", @@ -359,11 +361,13 @@ void test_submodule_status__iterator(void) }; static int expected_flags[] = { GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_MODIFIED, /* ".gitmodules" */ - 0, /* "just_a_dir/" will be skipped */ + -1, /* "just_a_dir/" will be skipped */ GIT_STATUS_CURRENT, /* "just_a_dir/contents" */ GIT_STATUS_CURRENT, /* "just_a_file" */ - GIT_STATUS_IGNORED, /* "not" (contains .git) */ - GIT_STATUS_IGNORED, /* "not-submodule" (contains .git) */ + GIT_STATUS_WT_NEW, /* "not-submodule/" untracked item */ + -1, /* "not-submodule/README.txt" */ + GIT_STATUS_WT_NEW, /* "not/" untracked item */ + -1, /* "not/README.txt" */ GIT_STATUS_CURRENT, /* "README.txt */ GIT_STATUS_INDEX_NEW, /* "sm_added_and_uncommited" */ GIT_STATUS_WT_MODIFIED, /* "sm_changed_file" */ |