git-pull: refuse default merge without branch.*.merge
Everybody hated the pull behaviour of merging the first branch listed on remotes/* file (or remote.*.fetch config) into the current branch. This finally corrects that UI wart by forbidding "git pull" without an explicit branch name on the command line or branch.$current.merge for the current branch. The matching change to git-clone was made to prepare the default branch.*.merge entry for the primary branch some time ago. Signed-off-by: Junio C Hamano <junkio@cox.net>
Junio C Hamano committed
Dec 16, 2006 at 01:36 UTC
a71fb0a1412c82405f078fb536797d3f5de68d53
1 file changed
+2
-1
git-parse-remote.sh
+2
-1
@@ -144,7 +144,8 @@ canon_refs_list_for_fetch () {
144
curr_branch=$(git-symbolic-ref HEAD | \
145
sed -e 's|^refs/heads/||')
146
merge_branches=$(git-repo-config \
147
- --get-all "branch.${curr_branch}.merge")
147
+ --get-all "branch.${curr_branch}.merge") ||
148
+ merge_branches=.this.would.never.match.any.ref.
149
fi
150
set x $(expand_refs_wildcard "$@")
151
shift