diff options
| author | Russell Belfer <rb@github.com> | 2013-07-02 16:49:57 -0700 | 
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-07-10 12:15:03 -0700 | 
| commit | 125655fe3f0caf8b3d9fff2ec45ec694b34eed04 (patch) | |
| tree | 677bb10e844cc18726ae2720e49987bd7aedfef0 /tests-clar/diff/workdir.c | |
| parent | 9564229af42b68d205376853410c55b957546a14 (diff) | |
| download | libgit2-125655fe3f0caf8b3d9fff2ec45ec694b34eed04.tar.gz | |
Untracked directories with .git should be ignored
This restores a behavior that was accidentally lost during some
diff refactoring where an untracked directory that contains a .git
item should be treated as IGNORED, not as UNTRACKED.  The submodule
code already detects this, but the diff code was not handling the
scenario right.
This also updates a number of existing tests that were actually
exercising the behavior but did not have the right expectations in
place.  It actually makes the new
`test_diff_submodules__diff_ignore_options` test feel much better
because the "not-a-submodule" entries are now ignored instead of
showing up as untracked items.
Fixes #1697
Diffstat (limited to 'tests-clar/diff/workdir.c')
| -rw-r--r-- | tests-clar/diff/workdir.c | 7 | 
1 files changed, 4 insertions, 3 deletions
| diff --git a/tests-clar/diff/workdir.c b/tests-clar/diff/workdir.c index 6a2504d09..c7fac1e48 100644 --- a/tests-clar/diff/workdir.c +++ b/tests-clar/diff/workdir.c @@ -776,6 +776,7 @@ void test_diff_workdir__submodules(void)  	opts.flags =  		GIT_DIFF_INCLUDE_UNTRACKED | +		GIT_DIFF_INCLUDE_IGNORED |  		GIT_DIFF_RECURSE_UNTRACKED_DIRS |  		GIT_DIFF_INCLUDE_UNTRACKED_CONTENT; @@ -806,7 +807,7 @@ void test_diff_workdir__submodules(void)  	 * only significant difference is that those Added items will show up  	 * as Untracked items in the pure libgit2 diff.  	 * -	 * Then add in the two extra untracked items "not" and "not-submodule" +	 * Then add in the two extra ignored items "not" and "not-submodule"  	 * to get the 12 files reported here.  	 */ @@ -815,8 +816,8 @@ void test_diff_workdir__submodules(void)  	cl_assert_equal_i(0, exp.file_status[GIT_DELTA_ADDED]);  	cl_assert_equal_i(0, exp.file_status[GIT_DELTA_DELETED]);  	cl_assert_equal_i(2, exp.file_status[GIT_DELTA_MODIFIED]); -	cl_assert_equal_i(0, exp.file_status[GIT_DELTA_IGNORED]); -	cl_assert_equal_i(10, exp.file_status[GIT_DELTA_UNTRACKED]); +	cl_assert_equal_i(2, exp.file_status[GIT_DELTA_IGNORED]); +	cl_assert_equal_i(8, exp.file_status[GIT_DELTA_UNTRACKED]);  	/* the following numbers match "git diff 873585" exactly */ | 
