summaryrefslogtreecommitdiff
path: root/t/t7607-merge-overwrite.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t7607-merge-overwrite.sh')
-rwxr-xr-xt/t7607-merge-overwrite.sh19
1 files changed, 18 insertions, 1 deletions
diff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh
index 4d5ce4e..c86e298 100755
--- a/t/t7607-merge-overwrite.sh
+++ b/t/t7607-merge-overwrite.sh
@@ -122,7 +122,7 @@ test_expect_success 'will not overwrite untracked file in leading path' '
rm -f sub sub2
'
-test_expect_failure SYMLINKS 'will not overwrite untracked symlink in leading path' '
+test_expect_success SYMLINKS 'will not overwrite untracked symlink in leading path' '
git reset --hard c0 &&
rm -rf sub &&
mkdir sub2 &&
@@ -150,10 +150,27 @@ test_expect_success 'will not overwrite untracked file on unborn branch' '
git rm -fr . &&
git checkout --orphan new &&
cp important c0.c &&
+ test_when_finished "rm 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_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_success '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