Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
git-pull: refuse default merge without branch.*.merge
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Dec 16, 2006
1 parent 61dde8f commit a71fb0a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-parse-remote.sh
Expand Up @@ -144,7 +144,8 @@ canon_refs_list_for_fetch () {
curr_branch=$(git-symbolic-ref HEAD | \
sed -e 's|^refs/heads/||')
merge_branches=$(git-repo-config \
--get-all "branch.${curr_branch}.merge")
--get-all "branch.${curr_branch}.merge") ||
merge_branches=.this.would.never.match.any.ref.
fi
set x $(expand_refs_wildcard "$@")
shift
Expand Down

0 comments on commit a71fb0a

Please sign in to comment.