diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-04-01 17:50:54 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-04-01 17:50:54 -0700 |
commit | 84dd63ee1d6ce08d7b85e4f1c4d7e77ef27a1578 (patch) | |
tree | 418f125d2547504da61041af79d2ae94b6cb6f07 /t | |
parent | 82d861f9d65080f5c66a5f3c956627af6ded78d9 (diff) | |
parent | 4b3ffe5184bd550dddacdd0b32b18ad0e73c7908 (diff) | |
download | git-84dd63ee1d6ce08d7b85e4f1c4d7e77ef27a1578.tar.gz git-84dd63ee1d6ce08d7b85e4f1c4d7e77ef27a1578.tar.xz |
Merge branch 'jk/pull-into-empty'
* jk/pull-into-empty:
pull: do not clobber untracked files on initial pull
merge: merge unborn index before setting ref
Diffstat (limited to 't')
-rwxr-xr-x | t/t5520-pull.sh | 11 | ||||
-rwxr-xr-x | t/t7607-merge-overwrite.sh | 4 |
2 files changed, 15 insertions, 0 deletions
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index 0470a81be..0e5eb678c 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh @@ -46,6 +46,17 @@ test_expect_success 'pulling into void using master:master' ' test_cmp file cloned-uho/file ' +test_expect_success 'pulling into void does not overwrite untracked files' ' + git init cloned-untracked && + ( + cd cloned-untracked && + echo untracked >file && + test_must_fail git pull .. master && + echo untracked >expect && + test_cmp expect file + ) +' + test_expect_success 'test . as a remote' ' git branch copy master && diff --git a/t/t7607-merge-overwrite.sh b/t/t7607-merge-overwrite.sh index c86e298d0..b54e840ee 100755 --- a/t/t7607-merge-overwrite.sh +++ b/t/t7607-merge-overwrite.sh @@ -157,6 +157,10 @@ test_expect_success 'will not overwrite untracked file on unborn branch' ' test_cmp important c0.c ' +test_expect_success 'failed merge leaves unborn branch in the womb' ' + test_must_fail git rev-parse --verify HEAD +' + test_expect_success 'set up unborn branch and content' ' git symbolic-ref HEAD refs/heads/unborn && rm -f .git/index && |