aboutsummaryrefslogtreecommitdiff
path: root/git-parse-remote.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-21 23:01:45 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-21 23:01:45 -0800
commit90cee090a0d7f950130d50df123551e43843e679 (patch)
treee66cfbfe0f204cd197ad3fef14ef339b828892b7 /git-parse-remote.sh
parent4264dc15e198bf9e9a2bb4ee897dd8e3eaabca47 (diff)
parentfa39b6b5b11f9b580c515a7b4a8e4eb8eaa79b75 (diff)
downloadgit-90cee090a0d7f950130d50df123551e43843e679.tar.xz
Merge branch 'master' into jc/fsck-reflog
* master: Introduce a global level warn() function. Rename imap-send's internal info/warn functions. _XOPEN_SOURCE problem also exists on FreeBSD parse-remote: mark all refs not for merge only when fetching more than one git-reset --hard: tell the user what the HEAD was reset to git-tag: support -F <file> option Revert "git-pull: refuse default merge without branch.*.merge" Suggest 'add' in am/revert/cherry-pick. Use git-merge-file in git-merge-one-file, too diff --check: fix off by one error Documentation/git-branch: new -r to delete remote-tracking branches. Fix system header problems on Mac OS X spurious .sp in manpages
Diffstat (limited to 'git-parse-remote.sh')
-rwxr-xr-xgit-parse-remote.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index ea7511e8a0..f163821d03 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -136,16 +136,22 @@ canon_refs_list_for_fetch () {
if test "$1" = "-d"
then
shift ; remote="$1" ; shift
+ set x $(expand_refs_wildcard "$@")
+ shift
if test "$remote" = "$(get_default_remote)"
then
curr_branch=$(git-symbolic-ref HEAD | \
sed -e 's|^refs/heads/||')
merge_branches=$(git-repo-config \
- --get-all "branch.${curr_branch}.merge") ||
- merge_branches=.this.would.never.match.any.ref.
+ --get-all "branch.${curr_branch}.merge")
+ fi
+ # If we are fetching only one branch, then first branch
+ # is the only thing that makes sense to merge anyway,
+ # so there is no point refusing that traditional rule.
+ if test $# != 1 && test "z$merge_branches" = z
+ then
+ merge_branches=..this..would..never..match..
fi
- set x $(expand_refs_wildcard "$@")
- shift
fi
for ref
do