Re: [PATCH 2/2] gc: Remove garbage .idx files from pack dir
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 17, 2015, 20:30 UTC
- Message-ID
- <xmqq37zhd5du.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <1439488973-11522-2-git-send-email-dougk.ff7@gmail.com>
Doug Kelly <dougk.ff7@gmail.com> writes:
Show 20 quoted lines
> +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.