Re: with git-next, git pull --rebase can print out "fatal: No such ref: ''" for branches without an upstream
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 17, 2014, 18:57 UTC
- Message-ID
- <xmqq8uuexwp7.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <20140117022152.GB12444@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 7 quoted lines
> On Thu, Jan 16, 2014 at 05:08:14PM -0800, Siddharth Agarwal wrote: > >> With git-next, where git pull --rebase can print out "fatal: No such >> ref: ''" if git pull --rebase is run on branches without an upstream. > > This is already fixed in bb3f458 (rebase: fix fork-point with zero > arguments, 2014-01-09), I think.
Doesn't the call to get_remote_merge_branch in this part
test -n "$curr_branch" &&
. git-parse-remote &&
remoteref="$(get_remote_merge_branch "$@" 2>/dev/null)" &&
oldremoteref=$(git merge-base --fork-point "$remoteref" $curr_branch)yield an empty string, feeding it to "merge-base --fork-point" as its first parameter?
Perhaps something like this is needed?
git-pull.sh | 1 + 1 file changed, 1 insertion(+)
diff --git a/git-pull.sh b/git-pull.sh index 605e957..467c66c 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -229,6 +229,7 @@ test true = "$rebase" && { test -n "$curr_branch" && . git-parse-remote && remoteref="$(get_remote_merge_branch "$@" 2>/dev/null)" && + test -n "$remoteref" && oldremoteref=$(git merge-base --fork-point "$remoteref" $curr_branch) } orig_head=$(git rev-parse -q --verify HEAD)