Skip to content

Commit c0f1f9d

Browse files
ttaylorrgitster
authored andcommitted
midx.c: lookup MIDX by object directory during repack
Apply similar treatment as in the last commit to the MIDX `repack` operation. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 98926e0 commit c0f1f9d

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

midx.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1861,7 +1861,7 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
18611861
struct child_process cmd = CHILD_PROCESS_INIT;
18621862
FILE *cmd_in;
18631863
struct strbuf base_name = STRBUF_INIT;
1864-
struct multi_pack_index *m = load_multi_pack_index(object_dir, 1);
1864+
struct multi_pack_index *m = lookup_multi_pack_index(r, object_dir);
18651865

18661866
/*
18671867
* When updating the default for these configuration
@@ -1933,11 +1933,8 @@ int midx_repack(struct repository *r, const char *object_dir, size_t batch_size,
19331933
}
19341934

19351935
result = write_midx_internal(object_dir, NULL, NULL, NULL, NULL, flags);
1936-
m = NULL;
19371936

19381937
cleanup:
1939-
if (m)
1940-
close_midx(m);
19411938
free(include_pack);
19421939
return result;
19431940
}

0 commit comments

Comments
 (0)