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:
authorRené Scharfe <l.s.r@web.de>2018-03-29 00:14:08 +0300
committerJunio C Hamano <gitster@pobox.com>2018-03-29 01:27:02 +0300
commit74b6bda32f8350b2dc32f8d66f4046272168184e (patch)
treed28392eae5310dd3009e5806ac78b891c49bf485 /t/t7400-submodule-basic.sh
parentd32eb83c1db7d0a8bb54fe743c6d1dd674d372c5 (diff)
submodule: check for NULL return of get_submodule_ref_store()
If we can't find a ref store for a submodule then assume the latter is not initialized (or was removed). Print a status line accordingly instead of causing a segmentation fault by passing NULL as the first parameter of refs_head_ref(). Reported-by: Jeremy Feusi <jeremy@feusi.co> Reviewed-by: Stefan Beller <sbeller@google.com> Initial-Test-By: Stefan Beller <sbeller@google.com> Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7400-submodule-basic.sh')
-rwxr-xr-xt/t7400-submodule-basic.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index a39e69a3eb..152104412f 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -821,6 +821,21 @@ test_expect_success 'moving the superproject does not break submodules' '
)
'
+test_expect_success 'moving the submodule does not break the superproject' '
+ (
+ cd addtest2 &&
+ git submodule status
+ ) >actual &&
+ sed -e "s/^ \([^ ]* repo\) .*/-\1/" <actual >expect &&
+ mv addtest2/repo addtest2/repo.bak &&
+ test_when_finished "mv addtest2/repo.bak addtest2/repo" &&
+ (
+ cd addtest2 &&
+ git submodule status
+ ) >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'submodule add --name allows to replace a submodule with another at the same path' '
(
cd addtest2 &&