summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2014-04-03 13:39:06 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-04-03 13:39:06 -0700
commit3097b687bea8817b4b0afd84db8c4b1079cea92f (patch)
treec7095afe521727f96b7ae6965cc967fc55377473 /t
parentMerge branch 'mh/remove-subtree-long-pathname-fix' into maint (diff)
parentmv: prevent mismatched data when ignoring errors. (diff)
downloadtgif-3097b687bea8817b4b0afd84db8c4b1079cea92f.tar.xz
Merge branch 'jk/mv-submodules-fix' into maint
* jk/mv-submodules-fix: mv: prevent mismatched data when ignoring errors. builtin/mv: fix out of bounds write Conflicts: t/t7001-mv.sh
Diffstat (limited to 't')
-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 e3c8c2c1b8..215d43d6a6 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