Re: [PATCHv4 5/8] clone: factor out checking for an alternate path

2016-08-15 Thread Stefan Beller
On Mon, Aug 15, 2016 at 1:36 PM, Junio C Hamano wrote: > >>> Why do you need "err_buf", instead of directly writing the error to >>> "err", especially if "err" is not optional? >>> + ... +out: + if (err_buf.len) { >> >> If we were directly writing to err, we

Re: [PATCHv4 5/8] clone: factor out checking for an alternate path

2016-08-15 Thread Junio C Hamano
Stefan Beller writes: > On Fri, Aug 12, 2016 at 3:25 PM, Junio C Hamano wrote: >> Stefan Beller writes: >> >>> + struct strbuf sb = STRBUF_INIT; >>> + char *ref_git = compute_alternate_path(item->string, ); >> >> Who owns the

Re: [PATCHv4 5/8] clone: factor out checking for an alternate path

2016-08-15 Thread Stefan Beller
On Fri, Aug 12, 2016 at 3:25 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> + struct strbuf sb = STRBUF_INIT; >> + char *ref_git = compute_alternate_path(item->string, ); > > Who owns the memory for ref_git? The caller of

Re: [PATCHv4 5/8] clone: factor out checking for an alternate path

2016-08-12 Thread Junio C Hamano
Stefan Beller writes: > + struct strbuf sb = STRBUF_INIT; > + char *ref_git = compute_alternate_path(item->string, ); Who owns the memory for ref_git? > - if (!access(mkpath("%s/shallow", ref_git), F_OK)) > - die(_("reference repository '%s' is