diff options
author | Junio C Hamano <gitster@pobox.com> | 2010-12-02 11:27:13 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-12-02 11:27:13 -0800 |
commit | 47f16e8b110d84bacb586a1b7183ee4bb781c980 (patch) | |
tree | a95b90d7863c72c41ba825d21c21fc1daf0edbba /t/t7607-merge-overwrite.sh | |
parent | Merge branch 'jk/add-e-doc' into maint (diff) | |
parent | do not overwrite untracked during merge from unborn branch (diff) | |
download | tgif-47f16e8b110d84bacb586a1b7183ee4bb781c980.tar.xz |
Merge branch 'cb/maint-orphan-merge-noclobber' into maint
* cb/maint-orphan-merge-noclobber:
do not overwrite untracked during merge from unborn branch
Diffstat (limited to 't/t7607-merge-overwrite.sh')
-rwxr-xr-x | t/t7607-merge-overwrite.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh index d82349a6a8..3988900fc3 100755 --- a/t/t7607-merge-overwrite.sh +++ b/t/t7607-merge-overwrite.sh @@ -84,4 +84,20 @@ test_expect_success 'will not overwrite removed file with staged changes' ' test_cmp important c1.c ' +cat >expect <<\EOF +error: Untracked working tree file 'c0.c' would be overwritten by merge. +fatal: read-tree failed +EOF + +test_expect_success 'will not overwrite untracked file on unborn branch' ' + git reset --hard c0 && + git rm -fr . && + git checkout --orphan new && + cp important c0.c && + test_must_fail git merge c0 2>out && + test_cmp out expect && + test_path_is_missing .git/MERGE_HEAD && + test_cmp important c0.c +' + test_done |