From: Andreas Ericsson Date: Sun, 11 Nov 2007 14:17:03 GMT Subject: Re: [PATCH 3/6] push: support pushing HEAD to real branch name Message-ID: <47370EDF.3090907@op5.se> In-Reply-To: <11947897083159-git-send-email-prohaska@zib.de> Steffen Prohaska wrote: > 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