Re: [PATCH 7/9] remote.c: teach branch_get() to treat symrefs other than HEAD
- From
Felipe Contreras <felipe.contreras@gmail.com>
- Date
- May 2, 2013, 16:57 UTC
- Message-ID
- <CAMP44s2j3TD67NX=OF5Qit7=_gi_cgyBrwuakLU4jwQvOhkFzA@mail.gmail.com>
- In-Reply-To
- <1367501974-6879-8-git-send-email-artagnon@gmail.com>
On Thu, May 2, 2013 at 8:39 AM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:
Show 5 quoted lines
> $ git symbolic-ref M refs/heads/master
> $ git show M@{u}
> $ git branch -u ram/master M
>
> This patch fixes branch_get() directly, making these work.It's not a fix, it's implementing brand new functionality, and changing old behaviors.
Show 10 quoted lines
> --- a/remote.c
> +++ b/remote.c
> @@ -1463,13 +1463,30 @@ void set_ref_status_for_push(struct ref *remote_refs, int send_mirror,
>
> struct branch *branch_get(const char *name)
> {
> - struct branch *ret;
> + struct branch *ret = NULL;
> +
> + /* Setup */I thought the preferred style for these kinds of comments was:
/* setup */
Show 5 quoted lines
> + git_config(handle_config, NULL); > + alias_all_urls(); > > - read_config(); > if (!name || !*name || !strcmp(name, "HEAD"))
I still see "HEAD" there. Didn't you say your patch makes "HEAD" less of a special ref? Why is it still here?
Show 9 quoted lines
> - ret = current_branch;
> + name = "HEAD";
> else
> ret = make_branch(name, 0);
> +
> + if (!ret || !ret->remote_name) {
> + /* Is this a symbolic-ref like HEAD, pointing to a
> + * valid branch?
> + */The style is:
/* * This is the preferred style for multi-line * comments in the Linux kernel source code. * Please use it consistently. * * Description: A column of asterisks on the left side, * with beginning and ending almost-blank lines. */
-- Felipe Contreras