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 /object-file.h | |
| parent | object-file: get rid of `the_repository` in `loose_object_info()` (diff) | |
| download | git-cbb388f3e53660c88220c40a8dddb976672ae03d.tar.gz git-cbb388f3e53660c88220c40a8dddb976672ae03d.zip | |
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 'object-file.h')
| -rw-r--r-- | object-file.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/object-file.h b/object-file.h index 5b63a05ab5..370139e076 100644 --- a/object-file.h +++ b/object-file.h @@ -218,8 +218,10 @@ enum finalize_object_file_flags { FOF_SKIP_COLLISION_CHECK = 1, }; -int finalize_object_file(const char *tmpfile, const char *filename); -int finalize_object_file_flags(const char *tmpfile, const char *filename, +int finalize_object_file(struct repository *repo, + const char *tmpfile, const char *filename); +int finalize_object_file_flags(struct repository *repo, + const char *tmpfile, const char *filename, enum finalize_object_file_flags flags); void hash_object_file(const struct git_hash_algo *algo, const void *buf, |
