From: Junio C Hamano Date: Sun, 28 Oct 2007 07:28:23 GMT Subject: Re: [PATCH 3/8] add get_sha1_with_real_ref() returning full name of ref on demand Message-ID: <7v8x5ny9yg.fsf@gitster.siamese.dyndns.org> In-Reply-To: <1193503808519-git-send-email-prohaska@zib.de> Steffen Prohaska writes: > The new function can be used by "git rev-parse" to print the full > name of the matched ref and can be used by "git send-pack" to expand > a local ref to its full name. "can be"? "will be used to implement git rev-parse --some-option"? > +static int get_sha1_1(const char *name, int len, unsigned char *sha1, char **real_ref); > > static int get_parent(const char *name, int len, > unsigned char *result, int idx) > { > unsigned char sha1[20]; > - int ret = get_sha1_1(name, len, sha1); > + int ret = get_sha1_1(name, len, sha1, /*real_ref=*/ 0); A null pointer constant in git sources is spelled as "NULL", not "0".