Skip to content

Commit

Permalink
builtin-gc.c: use new pack_keep bitfield to detect .keep file existence
Browse files Browse the repository at this point in the history
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Brandon Casey authored and Junio C Hamano committed Nov 12, 2008
1 parent f7991d1 commit 01af249
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions builtin-gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 01af249

Please sign in to comment.