On Thu, Jul 9, 2015 at 8:05 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote: >> Subject: Re: [PATCH v2] clone: Simplify string handling in guess_dir_name() > > We seem not to capitalize the first word on the subject line. Will change that. >> Content-Type: multipart/mixed; boundary="----=_Part_8_836493213.1436462597065" > > Please don't. This seems to come from submitgit, I've filed an issue about it: https://github.com/rtyley/submitgit/issues/17 What content type(s) would you accept? Only text/plain? >> - if (is_bare) { >> - struct strbuf result = STRBUF_INIT; >> - strbuf_addf(&result, "%.*s.git", (int)(end - start), start); >> - dir = strbuf_detach(&result, NULL); >> - } else >> - dir = xstrndup(start, end - start); >> + dir = is_bare ? xstrfmt("%.*s.git", (int)len, start) : xstrndup(start, len); > > This however I had to read twice. I'd say > > if (is_bare) > dir = xstrfmt(...); > else > dir = xstrndup(...); > > is much easier to read. That's what I had locally before. Will revert to that. -- Sebastian Schuberth -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html