@matheusbsbs / matheus-bagliano / commits / 01af249fa1
Fork 0

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>

Brandon Casey committed Nov 12, 2008 at 11:59 UTC 01af249fa15ce63ea69e89e3520022420ecb409c
1 file changed +1 -11
builtin-gc.c
+1 -11
@@ -134,19 +134,9 @@ static int too_many_packs(void)
134
135 prepare_packed_git();
136 for (cnt = 0, p = packed_git; p; p = p->next) {
137 - char path[PATH_MAX];
138 - size_t len;
139 - int keep;
140 -
137 if (!p->pack_local)
138 continue;
143 - len = strlen(p->pack_name);
144 - if (PATH_MAX <= len + 1)
145 - continue; /* oops, give up */
146 - memcpy(path, p->pack_name, len-5);
147 - memcpy(path + len - 5, ".keep", 6);
148 - keep = access(p->pack_name, F_OK) && (errno == ENOENT);
149 - if (keep)
139 + if (p->pack_keep)
140 continue;
141 /*
142 * Perhaps check the size of the pack and count only