aboutsummaryrefslogtreecommitdiff
path: root/pack.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-07-17 06:56:33 +0200
committerJunio C Hamano <gitster@pobox.com>2025-07-16 22:16:14 -0700
commitcbb388f3e53660c88220c40a8dddb976672ae03d (patch)
treef664f87596158d4851db3931a23d3459e3d04224 /pack.h
parent1efe0aeaa2e10766abe9bf05e2e1a014251ba4e2 (diff)
downloadgit-cbb388f3e53660c88220c40a8dddb976672ae03d.tar.xz
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 'pack.h')
-rw-r--r--pack.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/pack.h b/pack.h
index 5d4393eaff..ec76472e49 100644
--- a/pack.h
+++ b/pack.h
@@ -145,7 +145,8 @@ void stage_tmp_packfiles(struct repository *repo,
struct pack_idx_option *pack_idx_opts,
unsigned char hash[],
char **idx_tmp_name);
-void rename_tmp_packfile_idx(struct strbuf *basename,
+void rename_tmp_packfile_idx(struct repository *repo,
+ struct strbuf *basename,
char **idx_tmp_name);
#endif