Re: [PATCH v2 15/19] pull: teach git pull about --rebase
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 10, 2015, 23:02 UTC
- Message-ID
- <xmqqy4jrgob3.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1433314143-4478-16-git-send-email-pyokagan@gmail.com>
Paul Tan <pyokagan@gmail.com> writes:
Show 28 quoted lines
> +/**
> + * Returns remote's upstream branch for the current branch. If remote is NULL,
> + * the current branch's configured default remote is used. Returns NULL if
> + * `remote` does not name a valid remote, HEAD does not point to a branch,
> + * remote is not the branch's configured remote or the branch does not have any
> + * configured upstream branch.
> + */
> +static char *get_upstream_branch(const char *remote)
> +{
> + struct remote *rm;
> + struct branch *curr_branch;
> +
> + rm = remote_get(remote);
> + if (!rm)
> + return NULL;
> +
> + curr_branch = branch_get("HEAD");
> + if (!curr_branch)
> + return NULL;
> +
> + if (curr_branch->remote != rm)
> + return NULL;
> +
> + if (!curr_branch->merge_nr)
> + return NULL;
> +
> + return xstrdup(curr_branch->merge[0]->dst);
> +}This part needs to be rebased, as branch->remote no longer exists in the recent world order.