git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Jay Soffian <jaysoffian@gmail.com>
Cc: git@vger.kernel.org, Sam Vilain <sam.vilain@catalyst.net.nz>,
	Jeff King <peff@peff.net>, Junio C Hamano <junio@kernel.org>
Subject: Re: [PATCH] for-each-ref: fix objectname:short bug
Date: Fri, 27 Aug 2010 09:08:02 +0200	[thread overview]
Message-ID: <4C776452.8020200@drmicha.warpmail.net> (raw)
In-Reply-To: <1282858469-22116-1-git-send-email-jaysoffian@gmail.com>

Jay Soffian venit, vidit, dixit 26.08.2010 23:34:
> When objectname:short was introduced, it forgot to copy the result of
> find_unique_abbrev. Because the result of find_unique_abbrev is a
> pointer to static buffer, this resulted in the same value being
> substituted in for each ref.
> 
> Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
> ---
>  builtin/for-each-ref.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
> index a2b28c6..89e75c6 100644
> --- a/builtin/for-each-ref.c
> +++ b/builtin/for-each-ref.c
> @@ -228,7 +228,8 @@ static void grab_common_values(struct atom_value *val, int deref, struct object
>  			v->s = s;
>  		}
>  		else if (!strcmp(name, "objectname:short")) {
> -			v->s = find_unique_abbrev(obj->sha1, DEFAULT_ABBREV);
> +			v->s = xstrdup(find_unique_abbrev(obj->sha1,
> +							  DEFAULT_ABBREV));
>  		}
>  	}
>  }

3 words:

embarrassing - sorry - thanks!

Michael

      parent reply	other threads:[~2010-08-27  7:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-26 21:16 objectname:short bug? Jay Soffian
2010-08-26 21:34 ` [PATCH] for-each-ref: fix objectname:short bug Jay Soffian
2010-08-26 22:15   ` Jeff King
2010-08-27  7:08   ` Michael J Gruber [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C776452.8020200@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=jaysoffian@gmail.com \
    --cc=junio@kernel.org \
    --cc=peff@peff.net \
    --cc=sam.vilain@catalyst.net.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).