2009/6/18 Santi Béjar <santi@xxxxxxxxxxx> > > This function is used in "git pull --rebase" to know the tracking branch. > > Signed-off-by: Santi Béjar <santi@xxxxxxxxxxx> > --- > git-parse-remote.sh | 21 ++++++++++++--------- > 1 files changed, 12 insertions(+), 9 deletions(-) > > diff --git a/git-parse-remote.sh b/git-parse-remote.sh > index 5f47b18..1aa6ffe 100755 > --- a/git-parse-remote.sh > +++ b/git-parse-remote.sh [...] > @@ -83,13 +81,18 @@ get_remote_merge_branch () { > esac > expr "z$ref" : 'z.*:' >/dev/null || ref="${ref}:" > remote=$(expr "z$ref" : 'z\([^:]*\):') > - case "$remote" in > - '' | HEAD ) remote=HEAD ;; [...] > + while true ; do > + case "$remote" in > + '' | HEAD ) remote=;; I forgot to say that I changed the HEAD behavior because the remote HEAD and the local remote HEAD (origin/HEAD) can point to different branches, as the local remote HEAD represents your preference for which is the default remote branch. Santi -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html