summaryrefslogtreecommitdiff
path: root/prune-packed.c
diff options
context:
space:
mode:
Diffstat (limited to 'prune-packed.c')
-rw-r--r--prune-packed.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/prune-packed.c b/prune-packed.c
index 5306e8e..73f0f3a 100644
--- a/prune-packed.c
+++ b/prune-packed.c
@@ -26,6 +26,9 @@ static void prune_dir(int i, DIR *dir, char *pathname, int len)
else if (unlink(pathname) < 0)
error("unable to unlink %s", pathname);
}
+ pathname[len] = 0;
+ if (rmdir(pathname))
+ mkdir(pathname, 0777);
}
static void prune_packed_objects(void)
@@ -46,7 +49,7 @@ static void prune_packed_objects(void)
sprintf(pathname + len, "%02x/", i);
d = opendir(pathname);
if (!d)
- die("unable to open %s", pathname);
+ continue;
prune_dir(i, d, pathname, len + 3);
closedir(d);
}