diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-03-25 11:02:01 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-25 11:02:02 -0700 |
commit | 12de60ac7a870cf0717ebbd9a150100219559f83 (patch) | |
tree | f2d323951b9b2fcb6632a5092578388f83143313 /t/t7001-mv.sh | |
parent | 2dfefe0f89447ff4f358d5f294c0b56148a0df4c (diff) | |
parent | fb8a4e8079ab8fc37e9cde32957c35637280ab8f (diff) | |
download | git-12de60ac7a870cf0717ebbd9a150100219559f83.tar.gz git-12de60ac7a870cf0717ebbd9a150100219559f83.tar.xz |
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-x | t/t7001-mv.sh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/t/t7001-mv.sh b/t/t7001-mv.sh index e3c8c2c1b..215d43d6a 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 |