]> granicus.if.org Git - git/commitdiff
sparse-checkout: cone mode should not interact with .gitignore
authorDerrick Stolee <dstolee@microsoft.com>
Mon, 21 Oct 2019 13:56:26 +0000 (13:56 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Oct 2019 03:42:21 +0000 (12:42 +0900)
During the development of the sparse-checkout "cone mode" feature,
an incorrect placement of the initializer for "use_cone_patterns = 1"
caused warnings to show up when a .gitignore file was present with
non-cone-mode patterns. This was fixed in the original commit
introducing the cone mode, but now we should add a test to avoid
hitting this problem again in the future.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1091-sparse-checkout-builtin.sh

index 2db706a9e434659ff9493de5d144860b377b8487..4205e03449bc07480bcee3b2801d375998257172 100755 (executable)
@@ -283,4 +283,11 @@ test_expect_success 'fail when lock is taken' '
        test_i18ngrep "File exists" err
 '
 
+test_expect_success '.gitignore should not warn about cone mode' '
+       git -C repo config --worktree core.sparseCheckoutCone true &&
+       echo "**/bin/*" >repo/.gitignore &&
+       git -C repo reset --hard 2>err &&
+       test_i18ngrep ! "disabling cone patterns" err
+'
+
 test_done