From 97af7ff0553ed81bb905dbc0c8b0f9a0c10bfb3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santi=20B=C3=A9jar?= Date: Fri, 12 Jun 2009 00:39:18 +0200 Subject: parse-remote: function to get the tracking branch to be merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The only user of get_remote_refs_for_fetch was "git pull --rebase" and it only wanted the tracking branch to be merge. So, add a simple function (get_remote_merge_branch) with this new meaning. No behavior changes. The new function behaves like the old code in "git pull --rebase". In particular, it only works with the default refspec mapping and with remote branches, not tags. Signed-off-by: Santi BĂ©jar Signed-off-by: Junio C Hamano --- git-pull.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'git-pull.sh') diff --git a/git-pull.sh b/git-pull.sh index 35261539a..3cf26634a 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -125,12 +125,9 @@ test true = "$rebase" && { die "refusing to pull with rebase: your working tree is not up-to-date" . git-parse-remote && - origin="$1" - test -z "$origin" && origin=$(get_default_remote) - reflist="$(get_remote_refs_for_fetch "$@" 2>/dev/null | - sed "s|refs/heads/\(.*\):|\1|")" && + reflist="$(get_remote_merge_branch "$@" 2>/dev/null)" && oldremoteref="$(git rev-parse -q --verify \ - "refs/remotes/$origin/$reflist")" + "$reflist")" } orig_head=$(git rev-parse -q --verify HEAD) git fetch $verbosity --update-head-ok "$@" || exit 1 -- cgit v1.2.1