Re: [PATCHv2] fetch: Only call a new ref a "branch" if it's under refs/heads/.
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Apr 13, 2012, 20:07 UTC
- Message-ID
- <20120413200721.GA3549@burratino>
- In-Reply-To
- <1334336904-18649-1-git-send-email-marcnarc@xiplink.com>
marcnarc@xiplink.com wrote:
Show 8 quoted lines
> --- a/builtin/fetch.c
> +++ b/builtin/fetch.c
> @@ -293,14 +293,18 @@ static int update_local_ref(struct ref *ref,
> const char *msg;
> const char *what;
> int r;
> - if (!strncmp(ref->name, "refs/tags/", 10)) {
> + if (!prefixcmp(ref->name, "refs/tags/")) {This part is just a clean-up, right?
Show 12 quoted lines
> msg = "storing tag";
> what = _("[new tag]");
> }
> - else {
> + else if (!prefixcmp(ref->name, "refs/heads/")) {
> msg = "storing head";
> what = _("[new branch]");
> }
> + else {
> + msg = "storing ref";
> + what = _("[new ref]");
> + }Neat. I like it, for what it's worth.
Sincerely, Jonathan