]> Kevux Git Server - rit/commit
object-file: move `safe_create_leading_directories()` into "path.c"
authorPatrick Steinhardt <ps@pks.im>
Tue, 15 Apr 2025 09:38:15 +0000 (11:38 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Apr 2025 15:24:35 +0000 (08:24 -0700)
commit1a99fe8010642a71063536510c578c1543d763b4
tree1151da975bf092257d71b0c4420056265e9be0f8
parentd1fa670de07ec9d08fc1333b3addf746c7d304e2
object-file: move `safe_create_leading_directories()` into "path.c"

The `safe_create_leading_directories()` function and its relatives are
located in "object-file.c", which is not a good fit as they provide
generic functionality not related to objects at all. Move them into
"path.c", which already hosts `safe_create_dir()` and its relative
`safe_create_dir_in_gitdir()`.

"path.c" is free of `the_repository`, but the moved functions depend on
`the_repository` to read the "core.sharedRepository" config. Adapt the
function signature to accept a repository as argument to fix the issue
and adjust callers accordingly.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
27 files changed:
builtin/bugreport.c
builtin/clone.c
builtin/credential-cache--daemon.c
builtin/diagnose.c
builtin/difftool.c
builtin/fast-import.c
builtin/fsck.c
builtin/gc.c
builtin/init-db.c
builtin/log.c
builtin/mv.c
builtin/sparse-checkout.c
builtin/submodule--helper.c
builtin/worktree.c
commit-graph.c
dir.c
merge-recursive.c
midx-write.c
notes-merge.c
object-file.c
object-file.h
path.c
path.h
refs/files-backend.c
sequencer.c
server-info.c
submodule.c