mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
object-file: get rid of the_repository in finalize_object_file()
We implicitly depend on `the_repository` when moving an object file into place in `finalize_object_file()`. Get rid of this global dependency by passing in a repository. Note that one might be pressed to inject an object database instead of a repository. But the function doesn't really care about the ODB at all. All it does is to move a file into place while checking whether there is any collision. As such, the functionality it provides is independent of the object database and only needs the repository as parameter so that it can adjust permissions of the file we are about to finalize. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1efe0aeaa2
commit
cbb388f3e5
@@ -667,7 +667,7 @@ static void write_midx_reverse_index(struct write_midx_context *ctx,
|
||||
tmp_file = write_rev_file_order(ctx->repo, NULL, ctx->pack_order,
|
||||
ctx->entries_nr, midx_hash, WRITE_REV);
|
||||
|
||||
if (finalize_object_file(tmp_file, buf.buf))
|
||||
if (finalize_object_file(ctx->repo, tmp_file, buf.buf))
|
||||
die(_("cannot store reverse index file"));
|
||||
|
||||
strbuf_release(&buf);
|
||||
|
||||
Reference in New Issue
Block a user