diff options
-rwxr-xr-x | git-pull.sh | 2 | ||||
-rwxr-xr-x | t/t5520-pull.sh | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/git-pull.sh b/git-pull.sh index 63b063a7b..e31226b62 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -274,7 +274,7 @@ esac 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 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 && |