Re: [PATCH 29/67] use strip_suffix and xstrfmt to replace suffix

2015-09-16 Thread Eric Sunshine
On Wed, Sep 16, 2015 at 06:50:38AM -0400, Jeff King wrote: > On Wed, Sep 16, 2015 at 12:38:12AM -0400, Eric Sunshine wrote: > > > @@ -1524,9 +1525,9 @@ int finish_http_pack_request(struct > > > http_pack_request *preq) > > > lst = &((*lst)->next); > > > *lst = (*lst)->next;

Re: [PATCH 29/67] use strip_suffix and xstrfmt to replace suffix

2015-09-16 Thread Jeff King
On Wed, Sep 16, 2015 at 12:38:12AM -0400, Eric Sunshine wrote: > > @@ -1524,9 +1525,9 @@ int finish_http_pack_request(struct http_pack_request > > *preq) > > lst = &((*lst)->next); > > *lst = (*lst)->next; > > > > - tmp_idx = xstrdup(preq->tmpfile); > > - strcp

Re: [PATCH 29/67] use strip_suffix and xstrfmt to replace suffix

2015-09-15 Thread Eric Sunshine
On Tue, Sep 15, 2015 at 11:47 AM, Jeff King wrote: > When we want to convert "foo.pack" to "foo.idx", we do it by > duplicating the original string and then munging the bytes > in place. Let's use strip_suffix and xstrfmt instead, which > has several advantages: > > 1. It's more clear what the i

[PATCH 29/67] use strip_suffix and xstrfmt to replace suffix

2015-09-15 Thread Jeff King
When we want to convert "foo.pack" to "foo.idx", we do it by duplicating the original string and then munging the bytes in place. Let's use strip_suffix and xstrfmt instead, which has several advantages: 1. It's more clear what the intent is. 2. It does not implicitly rely on the fact that