Re: [PATCH] [GSOC] remove_temporary_files(): reimplement using iterators

2017-03-31 Thread Jeff King
On Sat, Apr 01, 2017 at 01:37:16AM -0400, Jeff King wrote: > We use that strbuf for the prefix-comparison, too, but the way it is > done is rather confusing. AFAICT, we could just be comparing against > "packtmp + strlen(packdir) + 1". Though it would be simpler still to > make "packtmp" just the

Re: [PATCH] [GSOC] remove_temporary_files(): reimplement using iterators

2017-03-31 Thread Jeff King
On Sat, Apr 01, 2017 at 03:24:58AM +0300, Robert Stanca wrote: > @@ -49,12 +51,7 @@ static void remove_temporary_files(void) > { > struct strbuf buf = STRBUF_INIT; > size_t dirlen, prefixlen; > - DIR *dir; > - struct dirent *e; > - > - dir = opendir(packdir); > - if (!

[PATCH] [GSOC] remove_temporary_files(): reimplement using iterators

2017-03-31 Thread Robert Stanca
Replaces recursive traversing of opendir with dir_iterator Signed-off-by: Robert Stanca --- builtin/repack.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/builtin/repack.c b/builtin/repack.c index 677bc7c81..dba465814 100644 --- a/builtin/repack.c +++ b/bu