Skip to content

Commit a71fb0a

Browse files
author
Junio C Hamano
committed
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>
1 parent 61dde8f commit a71fb0a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

git-parse-remote.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ canon_refs_list_for_fetch () {
144144
curr_branch=$(git-symbolic-ref HEAD | \
145145
sed -e 's|^refs/heads/||')
146146
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.
148149
fi
149150
set x $(expand_refs_wildcard "$@")
150151
shift

0 commit comments

Comments
 (0)