summaryrefslogtreecommitdiff
path: root/t/t7607-merge-overwrite.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-02-09 16:41:17 -0800
committerJunio C Hamano <gitster@pobox.com>2011-02-09 16:41:17 -0800
commit1a9fe453263137be7d42e6fbfc041b5b2d9521d7 (patch)
tree5d55b038cada0490cbf7aa69da76c7b6255de58e /t/t7607-merge-overwrite.sh
parent75513914784bb75447c71e3b001612ee37af386c (diff)
parent5b3270817712e8eedb468e906cb1042a5a311ad4 (diff)
downloadgit-1a9fe453263137be7d42e6fbfc041b5b2d9521d7.tar.gz
Merge branch 'tr/merge-unborn-clobber'
* tr/merge-unborn-clobber: Exhibit merge bug that clobbers index&WT Conflicts: t/t7607-merge-overwrite.sh
Diffstat (limited to 't/t7607-merge-overwrite.sh')
-rwxr-xr-xt/t7607-merge-overwrite.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh
index 4d5ce4e682..5f731a1177 100755
--- a/t/t7607-merge-overwrite.sh
+++ b/t/t7607-merge-overwrite.sh
@@ -156,4 +156,20 @@ test_expect_success 'will not overwrite untracked file on unborn branch' '
test_cmp important c0.c
'
+test_expect_success 'set up unborn branch and content' '
+ git symbolic-ref HEAD refs/heads/unborn &&
+ rm -f .git/index &&
+ echo foo > tracked-file &&
+ git add tracked-file &&
+ echo bar > untracked-file
+'
+
+test_expect_failure 'will not clobber WT/index when merging into unborn' '
+ git merge master &&
+ grep foo tracked-file &&
+ git show :tracked-file >expect &&
+ grep foo expect &&
+ grep bar untracked-file
+'
+
test_done