diff options
author | Brandon Casey <casey@nrlssc.navy.mil> | 2008-11-12 11:59:07 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-11-12 10:28:14 -0800 |
commit | 01af249fa15ce63ea69e89e3520022420ecb409c (patch) | |
tree | 37e4fda3fe14e1cda82b2da4113e8e0beb6993eb /builtin-gc.c | |
parent | f7991d1ed37502c0e98dfa95866dfc1a8b08d834 (diff) | |
download | git-01af249fa15ce63ea69e89e3520022420ecb409c.tar.gz git-01af249fa15ce63ea69e89e3520022420ecb409c.tar.xz |
builtin-gc.c: use new pack_keep bitfield to detect .keep file existence
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-gc.c')
-rw-r--r-- | builtin-gc.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/builtin-gc.c b/builtin-gc.c index fac200e0b..53a0d43b6 100644 --- a/builtin-gc.c +++ b/builtin-gc.c @@ -134,19 +134,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 |