summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 97b1b4f)
raw | patch | inline | side by side (parent: 97b1b4f)
author | Jeff King <peff@peff.net> | |
Fri, 25 Mar 2011 18:13:31 +0000 (14:13 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 25 Mar 2011 21:16:27 +0000 (14:16 -0700) |
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>
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>
git-pull.sh | patch | blob | history | |
t/t5520-pull.sh | patch | blob | history |
diff --git a/git-pull.sh b/git-pull.sh
index 63b063a7b284bac5b10a9bd6fe879e5717bee2f3..e31226b62fb8b50d918b1e418bb1607f24070bd0 100755 (executable)
--- a/git-pull.sh
+++ b/git-pull.sh
if test -z "$orig_head"
then
git update-ref -m "initial pull" HEAD $merge_head "$curr_head" &&
- git read-tree --reset -u HEAD || exit 1
+ git read-tree -m -u HEAD || exit 1
exit
fi
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 0470a81be0edaf883788d313778ef6865ed34c6f..0e5eb678ce6b2f4fad79c39947455e5284313ba4 100755 (executable)
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
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 &&