summaryrefslogtreecommitdiff
path: root/packfile.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2018-08-20 16:51:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-20 22:31:39 (GMT)
commitfe86c3beb5893edd4e5648dab8cca66d6cc2e77d (patch)
tree90107409556e5311e9a2f40a4aa1b561c5b4f6c3 /packfile.c
parentc39b02ae0ae90b9fda353f87502ace9ba36db839 (diff)
downloadgit-fe86c3beb5893edd4e5648dab8cca66d6cc2e77d.zip
git-fe86c3beb5893edd4e5648dab8cca66d6cc2e77d.tar.gz
git-fe86c3beb5893edd4e5648dab8cca66d6cc2e77d.tar.bz2
midx: stop reporting garbage
When prepare_packed_git is called with the report_garbage method initialized, we report unexpected files in the objects directory as garbage. Stop reporting the multi-pack-index and the pack-files it covers as garbage. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'packfile.c')
-rw-r--r--packfile.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/packfile.c b/packfile.c
index 896da46..fe713a0 100644
--- a/packfile.c
+++ b/packfile.c
@@ -820,9 +820,8 @@ static void prepare_pack(const char *full_name, size_t full_name_len,
struct packed_git *p;
size_t base_len = full_name_len;
- if (strip_suffix_mem(full_name, &base_len, ".idx")) {
- if (data->m && midx_contains_pack(data->m, file_name))
- return;
+ if (strip_suffix_mem(full_name, &base_len, ".idx") &&
+ !(data->m && midx_contains_pack(data->m, file_name))) {
/* Don't reopen a pack we already have. */
for (p = data->r->objects->packed_git; p; p = p->next) {
size_t len;
@@ -842,6 +841,8 @@ static void prepare_pack(const char *full_name, size_t full_name_len,
if (!report_garbage)
return;
+ if (!strcmp(file_name, "multi-pack-index"))
+ return;
if (ends_with(file_name, ".idx") ||
ends_with(file_name, ".pack") ||
ends_with(file_name, ".bitmap") ||