]> git.ipfire.org Git - thirdparty/git.git/commit
object-store: move and rename `odb_pack_keep()`
authorPatrick Steinhardt <ps@pks.im>
Tue, 29 Apr 2025 07:52:17 +0000 (09:52 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 29 Apr 2025 17:08:12 +0000 (10:08 -0700)
commit0b8ed25b66aedc9f4fe44d1a5cab2719290b22a9
tree65a7f303e6d38747541900fc449abc43288a70a1
parent56ef85e82ffa39ac86db39bc0ac11c67451d0e5b
object-store: move and rename `odb_pack_keep()`

The function `odb_pack_keep()` creates a file at the passed-in path. If
this fails, then the function re-tries by first creating any potentially
missing leading directories and then trying to create the file once
again. As such, this function doesn't host any kind of logic that is
specific to the object store, but is rather a generic helper function.

Rename the function to `safe_create_file_with_leading_directories()` and
move it into "path.c". While at it, refactor it so that it loses its
dependency on `the_repository`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fast-import.c
builtin/index-pack.c
object-store.c
object-store.h
path.c
path.h