Re: [PATCH 3/8] add get_sha1_with_real_ref() returning full name of ref on demand
Steffen Prohaska <prohaska@zib.de> 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"?
Show 8 quoted lines
> +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".