static struct argv_array prune_worktrees = ARGV_ARRAY_INIT;
static struct argv_array rerere = ARGV_ARRAY_INIT;
-static char *pidfile;
-
-static void remove_pidfile(void)
-{
- if (pidfile)
- unlink(pidfile);
-}
-
-static void remove_pidfile_on_signal(int signo)
-{
- remove_pidfile();
- sigchain_pop(signo);
- raise(signo);
-}
+static struct tempfile pidfile;
+static struct lock_file log_lock;
+ static struct string_list pack_garbage = STRING_LIST_INIT_DUP;
+
+ 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 report_pack_garbage(unsigned seen_bits, const char *path)
+ {
+ if (seen_bits == PACKDIR_FILE_IDX)
+ string_list_append(&pack_garbage, path);
+ }
+
static void git_config_date_string(const char *key, const char **output)
{
if (git_config_get_string_const(key, output))