summaryrefslogtreecommitdiff
path: root/builtin-gc.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-11-12 22:00:43 -0800
committerJunio C Hamano <gitster@pobox.com>2008-11-12 22:00:43 -0800
commitecbbfb15a42987deb6620c4575c420002313af23 (patch)
tree541cc88566a9cac6f8bf473c31879bf536f71c5c /builtin-gc.c
parenta5b2d4ac24ef18cf8c628e258bef8a20d9bf4b2b (diff)
parent3289b9dec56d34fe05f90c262d11adc0a61e16e7 (diff)
downloadgit-ecbbfb15a42987deb6620c4575c420002313af23.tar.gz
Merge branch 'bc/maint-keep-pack'
* bc/maint-keep-pack: t7700: test that 'repack -a' packs alternate packed objects pack-objects: extend --local to mean ignore non-local loose objects too sha1_file.c: split has_loose_object() into local and non-local counterparts t7700: demonstrate mishandling of loose objects in an alternate ODB builtin-gc.c: use new pack_keep bitfield to detect .keep file existence repack: do not fall back to incremental repacking with [-a|-A] repack: don't repack local objects in packs with .keep file pack-objects: new option --honor-pack-keep packed_git: convert pack_local flag into a bitfield and add pack_keep t7700: demonstrate mishandling of objects in packs with a .keep file
Diffstat (limited to 'builtin-gc.c')
-rw-r--r--builtin-gc.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/builtin-gc.c b/builtin-gc.c
index 7af65bb31b..781df601c5 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