Re: [PATCH 3/3] setup: add `clear_repository_format()`

2018-12-19 Thread Martin Ågren
On Wed, 19 Dec 2018 at 16:48, Jeff King wrote: > > On Tue, Dec 18, 2018 at 08:25:28AM +0100, Martin Ågren wrote: > > > +void clear_repository_format(struct repository_format *format) > > +{ > > + string_list_clear(&format->unknown_extensions, 0); > > + free(format->work_tree); > > + fr

Re: [PATCH 3/3] setup: add `clear_repository_format()`

2018-12-19 Thread Jeff King
On Tue, Dec 18, 2018 at 08:25:28AM +0100, Martin Ågren wrote: > After we set up a `struct repository_format`, it owns various pieces of > allocated memory. We then either use those members, because we decide we > want to use the "candidate" repository format, or we discard the > candidate / scratc

[PATCH 3/3] setup: add `clear_repository_format()`

2018-12-17 Thread Martin Ågren
After we set up a `struct repository_format`, it owns various pieces of allocated memory. We then either use those members, because we decide we want to use the "candidate" repository format, or we discard the candidate / scratch space. In the first case, we transfer ownership of the memory to a fe