From: Junio C Hamano Date: Wed, 6 Dec 2017 17:23:38 +0000 (-0800) Subject: Merge branch 'jt/submodule-tests-cleanup' X-Git-Tag: v2.16.0-rc0~77 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e8b96bd053524f1e77f35e6d12120a692a3e4844;p=thirdparty%2Fgit.git Merge branch 'jt/submodule-tests-cleanup' Further test clean-up. * jt/submodule-tests-cleanup: Tests: clean up submodule recursive helpers --- e8b96bd053524f1e77f35e6d12120a692a3e4844 diff --cc t/lib-submodule-update.sh index 9058bf978a,f39ec30951..38dadd2c29 --- a/t/lib-submodule-update.sh +++ b/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 &&