Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Ospite <ao2@ao2.it>2018-10-05 16:05:58 +0300
committerJunio C Hamano <gitster@pobox.com>2018-10-09 06:40:21 +0300
commit23dd8f5bb104d01b90e2f7a3f2e1acf0a205083e (patch)
treecd91f04a4f0b47e08225a2041cb4bc80a3084287 /t/t7506-status-submodule.sh
parentb2faad44e2686cb996b9bf2a2dd22f787fc05f16 (diff)
t7506: clean up .gitmodules properly before setting up new scenario
In t/t7506-status-submodule.sh at some point a new scenario is set up to test different things, in particular new submodules are added which are meant to completely replace the previous ones. However before calling the "git submodule add" commands for the new layout, the .gitmodules file is removed only from the working tree still leaving the previous content in current branch. This can break if, in the future, "git submodule add" starts differentiating between the following two cases: - .gitmodules is not in the working tree but it is in the current branch (it may not be safe to add new submodules in this case); - .gitmodules is neither in the working tree nor anywhere in the current branch (it is safe to add new submodules). Since the test intends to get rid of .gitmodules anyways, let's completely remove it from the current branch, to actually start afresh in the new scenario. This is more future-proof and does not break current tests. Signed-off-by: Antonio Ospite <ao2@ao2.it> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7506-status-submodule.sh')
-rwxr-xr-xt/t7506-status-submodule.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
index 943708fb04..08629a6e70 100755
--- a/t/t7506-status-submodule.sh
+++ b/t/t7506-status-submodule.sh
@@ -325,7 +325,8 @@ test_expect_success 'setup superproject with untracked file in nested submodule'
(
cd super &&
git clean -dfx &&
- rm .gitmodules &&
+ git rm .gitmodules &&
+ git commit -m "remove .gitmodules" &&
git submodule add -f ./sub1 &&
git submodule add -f ./sub2 &&
git submodule add -f ./sub1 sub3 &&