diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-07-17 06:56:33 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-07-16 22:16:14 -0700 |
| commit | cbb388f3e53660c88220c40a8dddb976672ae03d (patch) | |
| tree | f664f87596158d4851db3931a23d3459e3d04224 /tmp-objdir.c | |
| parent | 1efe0aeaa2e10766abe9bf05e2e1a014251ba4e2 (diff) | |
| download | git-cbb388f3e53660c88220c40a8dddb976672ae03d.tar.gz | |
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>
Diffstat (limited to 'tmp-objdir.c')
| -rw-r--r-- | tmp-objdir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tmp-objdir.c b/tmp-objdir.c index ae01eae9c4..9f5a1788cd 100644 --- a/tmp-objdir.c +++ b/tmp-objdir.c @@ -227,7 +227,7 @@ static int migrate_one(struct tmp_objdir *t, return -1; return migrate_paths(t, src, dst, flags); } - return finalize_object_file_flags(src->buf, dst->buf, flags); + return finalize_object_file_flags(t->repo, src->buf, dst->buf, flags); } static int is_loose_object_shard(const char *name) |
