aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/index-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2025-05-12 14:22:48 -0700
committerJunio C Hamano <gitster@pobox.com>2025-05-12 14:22:49 -0700
commitbd99d6e8db5e2c56dd24395e9711ee7ee564bf4f (patch)
treeb80e6131d230f068d29be426103f2b7fd87150b1 /builtin/index-pack.c
parentMerge branch 'ag/send-email-outlook' (diff)
parentobject-store: drop `repo_has_object_file()` (diff)
downloadgit-bd99d6e8db5e2c56dd24395e9711ee7ee564bf4f.tar.gz
git-bd99d6e8db5e2c56dd24395e9711ee7ee564bf4f.zip
Merge branch 'ps/object-store-cleanup'
Further code clean-up in the object-store layer. * ps/object-store-cleanup: object-store: drop `repo_has_object_file()` treewide: convert users of `repo_has_object_file()` to `has_object()` object-store: allow fetching objects via `has_object()` object-store: move function declarations to their respective subsystems object-store: move and rename `odb_pack_keep()` object-store: drop `loose_object_path()` object-store: move `struct packed_git` into "packfile.h"
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 60a8ee05db..147e9b8b47 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -892,9 +892,8 @@ static void sha1_object(const void *data, struct object_entry *obj_entry,
if (startup_info->have_repository) {
read_lock();
- collision_test_needed =
- repo_has_object_file_with_flags(the_repository, oid,
- OBJECT_INFO_QUICK);
+ collision_test_needed = has_object(the_repository, oid,
+ HAS_OBJECT_FETCH_PROMISOR);
read_unlock();
}
@@ -1565,7 +1564,7 @@ static void write_special_file(const char *suffix, const char *msg,
else
filename = odb_pack_name(the_repository, &name_buf, hash, suffix);
- fd = odb_pack_keep(filename);
+ fd = safe_create_file_with_leading_directories(the_repository, filename);
if (fd < 0) {
if (errno != EEXIST)
die_errno(_("cannot write %s file '%s'"),