summaryrefslogtreecommitdiff
path: root/t/t7001-mv.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-03-25 18:02:01 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-03-25 18:02:02 (GMT)
commit12de60ac7a870cf0717ebbd9a150100219559f83 (patch)
treef2d323951b9b2fcb6632a5092578388f83143313 /t/t7001-mv.sh
parent2dfefe0f89447ff4f358d5f294c0b56148a0df4c (diff)
parentfb8a4e8079ab8fc37e9cde32957c35637280ab8f (diff)
downloadgit-12de60ac7a870cf0717ebbd9a150100219559f83.zip
git-12de60ac7a870cf0717ebbd9a150100219559f83.tar.gz
git-12de60ac7a870cf0717ebbd9a150100219559f83.tar.bz2
Merge branch 'jk/mv-submodules-fix'
"git mv" that moves a submodule forgot to adjust the array that uses to keep track of which submodules were to be moved to update its configuration. * jk/mv-submodules-fix: mv: prevent mismatched data when ignoring errors. builtin/mv: fix out of bounds write
Diffstat (limited to 't/t7001-mv.sh')
-rwxr-xr-xt/t7001-mv.sh13
1 files changed, 12 insertions, 1 deletions
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh
index e3c8c2c..215d43d 100755
--- a/t/t7001-mv.sh
+++ b/t/t7001-mv.sh
@@ -294,7 +294,8 @@ test_expect_success 'setup submodule' '
git submodule add ./. sub &&
echo content >file &&
git add file &&
- git commit -m "added sub and file"
+ git commit -m "added sub and file" &&
+ git branch submodule
'
test_expect_success 'git mv cannot move a submodule in a file' '
@@ -463,4 +464,14 @@ test_expect_success 'checking out a commit before submodule moved needs manual u
! test -s actual
'
+test_expect_success 'mv -k does not accidentally destroy submodules' '
+ git checkout submodule &&
+ mkdir dummy dest &&
+ git mv -k dummy sub dest &&
+ git status --porcelain >actual &&
+ grep "^R sub -> dest/sub" actual &&
+ git reset --hard &&
+ git checkout .
+'
+
test_done