local_force=
test "z$lref" = "z$ref" || local_force='+'
echo "$ls_remote_result" |
+ sed -e '/\^{}$/d' |
(
IFS=' '
while read sha1 name
do
+ # ignore the ones that do not start with $from
mapped=${name#"$from"}
- if test "z$name" != "z${name%'^{}'}" ||
- test "z$name" = "z$mapped"
- then
- continue
- fi
+ test "z$name" = "z$mapped" && continue
echo "${local_force}${name}:${to}${mapped}"
done
)
# or the first one otherwise; add prefix . to the rest
# to prevent the secondary branches to be merged by default.
merge_branches=
+ curr_branch=
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 | \
merge_branches=$(git-repo-config \
--get-all "branch.${curr_branch}.merge")
fi
- set x $(expand_refs_wildcard "$@")
- shift
+ # 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
fi
for ref
do