Re: [RFC/PATCH 2/2] get_remote_merge_branch: Support for arbitrary mapping
- From
- Santi Béjar <santi@agolina.net>
- Date
- Jun 18, 2009, 09:27 UTC
- Message-ID
- <adf1fd3d0906180227t4da5c0cby3b0e71b132eae68@mail.gmail.com>
- In-Reply-To
- <1245311834-5290-4-git-send-email-santi@agolina.net>
2009/6/18 Santi Béjar <santi@agolina.net>
Show 12 quoted lines
> > This function is used in "git pull --rebase" to know the tracking branch. > > Signed-off-by: Santi Béjar <santi@agolina.net> > --- > 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
[...]
Show 6 quoted lines
> @@ -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