X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-gc.c;h=781df601c5f95e874297e0e8bec3fddeb929cc2d;hb=936b7057e8401665a2d106e8de018561db6333fe;hp=7af65bb31bfbf3e9a0e47901d44168389d736d20;hpb=bfd59c493d2be76adbc281df15a20aae766128fc;p=git.git diff --git a/builtin-gc.c b/builtin-gc.c index 7af65bb31..781df601c 100644 --- a/builtin-gc.c +++ b/builtin-gc.c @@ -131,19 +131,9 @@ static int too_many_packs(void) prepare_packed_git(); for (cnt = 0, p = packed_git; p; p = p->next) { - char path[PATH_MAX]; - size_t len; - int keep; - if (!p->pack_local) continue; - len = strlen(p->pack_name); - if (PATH_MAX <= len + 1) - continue; /* oops, give up */ - memcpy(path, p->pack_name, len-5); - memcpy(path + len - 5, ".keep", 6); - keep = access(p->pack_name, F_OK) && (errno == ENOENT); - if (keep) + if (p->pack_keep) continue; /* * Perhaps check the size of the pack and count only