Merge branch 'jt/submodule-tests-cleanup'
authorJunio C Hamano <gitster@pobox.com>
Wed, 6 Dec 2017 17:23:38 +0000 (09:23 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Dec 2017 17:23:38 +0000 (09:23 -0800)
Further test clean-up.

* jt/submodule-tests-cleanup:
  Tests: clean up submodule recursive helpers

1  2 
t/lib-submodule-update.sh

@@@ -661,51 -657,6 +657,23 @@@ test_submodule_recursing_with_args_comm
                        test_submodule_content sub1 origin/add_sub1
                )
        '
-       # ... unless there is an untracked file in its place.
-       test_expect_success "$command: added submodule doesn't remove untracked file with same name" '
-               prolog &&
-               reset_work_tree_to_interested no_submodule &&
-               (
-                       cd submodule_update &&
-                       git branch -t add_sub1 origin/add_sub1 &&
-                       : >sub1 &&
-                       test_must_fail $command add_sub1 &&
-                       test_superproject_content origin/no_submodule &&
-                       test_must_be_empty sub1
-               )
-       '
-       # ... but an ignored file is fine.
-       test_expect_$RESULTOI "$command: added submodule removes an untracked ignored file" '
-               test_when_finished "rm submodule_update/.git/info/exclude" &&
-               prolog &&
-               reset_work_tree_to_interested no_submodule &&
-               (
-                       cd submodule_update &&
-                       git branch -t add_sub1 origin/add_sub1 &&
-                       : >sub1 &&
-                       echo sub1 >.git/info/exclude
-                       $command add_sub1 &&
-                       test_superproject_content origin/add_sub1 &&
-                       test_submodule_content sub1 origin/add_sub1
-               )
-       '
 +      test_expect_success "$command: submodule branch is not changed, detach HEAD instead" '
 +              prolog &&
 +              reset_work_tree_to_interested add_sub1 &&
 +              (
 +                      cd submodule_update &&
 +                      git -C sub1 checkout -b keep_branch &&
 +                      git -C sub1 rev-parse HEAD >expect &&
 +                      git branch -t check-keep origin/modify_sub1 &&
 +                      $command check-keep &&
 +                      test_superproject_content origin/modify_sub1 &&
 +                      test_submodule_content sub1 origin/modify_sub1 &&
 +                      git -C sub1 rev-parse keep_branch >actual &&
 +                      test_cmp expect actual &&
 +                      test_must_fail git -C sub1 symbolic-ref HEAD
 +              )
 +      '
 +
        # Replacing a tracked file with a submodule produces a checked out submodule
        test_expect_success "$command: replace tracked file with submodule checks out submodule" '
                prolog &&