From: Junio C Hamano Date: Mon, 17 Aug 2015 20:30:53 GMT Subject: Re: [PATCH 2/2] gc: Remove garbage .idx files from pack dir Message-ID: In-Reply-To: <1439488973-11522-2-git-send-email-dougk.ff7@gmail.com> Doug Kelly writes: > +static struct string_list pack_garbage = STRING_LIST_INIT_DUP; > + > static char *pidfile; > > +static void clean_pack_garbage(void) > +{ > + int i; > + for (i = 0; i < pack_garbage.nr; i++) > + unlink_or_warn(pack_garbage.items[i].string); > + string_list_clear(&pack_garbage, 0); > +} > + > static void remove_pidfile(void) > { > if (pidfile) > @@ -57,6 +67,12 @@ static void remove_pidfile_on_signal(int signo) > raise(signo); > } > > +static void report_pack_garbage(unsigned seen_bits, const char *path) This change makes"pidfile management" and "pack garbage cleaning" tangled in the result. By inserting the definition of the variable pack_garbage and the function clean_pack_garbage() just before this new function, you can keep everything related to 'pack garbage cleaning" together.