summaryrefslogtreecommitdiff
path: root/t/t5520-pull.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2011-03-25 14:13:31 -0400
committerJunio C Hamano <gitster@pobox.com>2011-03-25 14:16:27 -0700
commit4b3ffe5184bd550dddacdd0b32b18ad0e73c7908 (patch)
tree1957ccd2bee4a761f410219c8fa60cd46b438ad9 /t/t5520-pull.sh
parent97b1b4f3a682377aa8f03348618e79bd1df1772e (diff)
downloadgit-4b3ffe5184bd550dddacdd0b32b18ad0e73c7908.tar.gz
pull: do not clobber untracked files on initial pull
For a pull into an unborn branch, we do not use "git merge" at all. Instead, we call read-tree directly. However, we used the --reset parameter instead of "-m", which turns off the safety features. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5520-pull.sh')
-rwxr-xr-xt/t5520-pull.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 0470a81be0..0e5eb678ce 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 &&