OSDN Git Service

t/lib-submodule-update.sh: fix test ignoring ignored files in submodules
authorStefan Beller <sbeller@google.com>
Fri, 5 Jan 2018 20:03:02 +0000 (12:03 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Jan 2018 20:35:35 +0000 (12:35 -0800)
It turns out that the test replacing a submodule with a file with
the submodule containing an ignored file is incorrectly titled,
because the test put the file in place, but never ignored that file.
When having an untracked file Instead of an ignored file in the
submodule, git should refuse to remove the submodule, but that is
a bug in the implementation of recursing into submodules, such that
the test just passed, removing the untracked file.

Fix the test first; in a later patch we'll fix gits behavior,
that will make sure untracked files are not deleted.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-submodule-update.sh

index d769904..fb0173e 100755 (executable)
@@ -885,6 +885,7 @@ test_submodule_switch_recursing_with_args () {
                (
                        cd submodule_update &&
                        git branch -t replace_sub1_with_file origin/replace_sub1_with_file &&
+                       echo ignored >.git/modules/sub1/info/exclude &&
                        : >sub1/ignored &&
                        $command replace_sub1_with_file &&
                        test_superproject_content origin/replace_sub1_with_file &&