1189
return 0;
1190
}
1191
1192
-static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e)
1192
+static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e, const char **ignore_packed)
1193
{
1194
struct packed_git *p;
1195
prepare_packed_git();
1196
1197
for (p = packed_git; p; p = p->next) {
1198
+ if (ignore_packed) {
1199
+ const char **ig;
1200
+ for (ig = ignore_packed; *ig; ig++)
1201
+ if (!strcmp(p->pack_name, *ig))
1202
+ break;
1203
+ if (*ig)
1204
+ continue;
1205
+ }
1206
if (find_pack_entry_one(sha1, e, p))
1207
return 1;
1208
}
1235
if (!map) {
1236
struct pack_entry e;
1237
1230
- if (find_pack_entry(sha1, &e))
1238
+ if (find_pack_entry(sha1, &e, NULL))
1239
return packed_object_info(&e, type, sizep);
1240
reprepare_packed_git();
1233
- if (find_pack_entry(sha1, &e))
1241
+ if (find_pack_entry(sha1, &e, NULL))
1242
return packed_object_info(&e, type, sizep);
1243
return error("unable to find %s", sha1_to_hex(sha1));
1244
}
1261
{
1262
struct pack_entry e;
1263
1256
- if (!find_pack_entry(sha1, &e)) {
1264
+ if (!find_pack_entry(sha1, &e, NULL)) {
1265
error("cannot read sha1_file for %s", sha1_to_hex(sha1));
1266
return NULL;
1267
}
1274
void *map, *buf;
1275
struct pack_entry e;
1276
1269
- if (find_pack_entry(sha1, &e))
1277
+ if (find_pack_entry(sha1, &e, NULL))
1278
return read_packed_sha1(sha1, type, size);
1279
map = map_sha1_file(sha1, &mapsize);
1280
if (map) {
1283
return buf;
1284
}
1285
reprepare_packed_git();
1278
- if (find_pack_entry(sha1, &e))
1286
+ if (find_pack_entry(sha1, &e, NULL))
1287
return read_packed_sha1(sha1, type, size);
1288
return NULL;
1289
}
1715
return 1;
1716
}
1717
1710
-int has_sha1_pack(const unsigned char *sha1)
1718
+int has_sha1_pack(const unsigned char *sha1, const char **ignore_packed)
1719
{
1720
struct pack_entry e;
1713
- return find_pack_entry(sha1, &e);
1721
+ return find_pack_entry(sha1, &e, ignore_packed);
1722
}
1723
1724
int has_sha1_file(const unsigned char *sha1)
1726
struct stat st;
1727
struct pack_entry e;
1728
1721
- if (find_pack_entry(sha1, &e))
1729
+ if (find_pack_entry(sha1, &e, NULL))
1730
return 1;
1731
return find_sha1_file(sha1, &st) ? 1 : 0;
1732
}