Re: [PATCH 3/6] push: support pushing HEAD to real branch name
Show 14 quoted lines
> diff --git a/builtin-push.c b/builtin-push.c
> index 6d1da07..a99ba0c 100644
> --- a/builtin-push.c
> +++ b/builtin-push.c
> @@ -44,6 +44,15 @@ static void set_refspecs(const char **refs, int nr)
> strcat(tag, refs[i]);
> ref = tag;
> }
> + if (!strcmp("HEAD", ref)) {
> + unsigned char sha1_dummy[20];
> + ref = resolve_ref(ref, sha1_dummy, 1, NULL);
> + if (!ref)
> + die("HEAD cannot be resolved.");
> + if (strncmp(ref, "refs/heads/", 11))Why not prefixcmp(ref, "refs/heads/")?
--
Andreas Ericsson andreas.ericsson@op5.se
OP5 AB www.op5.se
Tel: +46 8-230225 Fax: +46 8-230231