diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-04-15 11:38:15 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-04-15 08:24:35 -0700 |
| commit | 1a99fe8010642a71063536510c578c1543d763b4 (patch) | |
| tree | 1151da975bf092257d71b0c4420056265e9be0f8 /midx-write.c | |
| parent | object-file: move `mkdir_in_gitdir()` into "path.c" (diff) | |
| download | git-1a99fe8010642a71063536510c578c1543d763b4.tar.gz git-1a99fe8010642a71063536510c578c1543d763b4.zip | |
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>
Diffstat (limited to 'midx-write.c')
| -rw-r--r-- | midx-write.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/midx-write.c b/midx-write.c index a628ac24dc..fbba55f9d9 100644 --- a/midx-write.c +++ b/midx-write.c @@ -1086,7 +1086,7 @@ static int write_midx_internal(struct repository *r, const char *object_dir, object_dir); else get_midx_filename(r->hash_algo, &midx_name, object_dir); - if (safe_create_leading_directories(midx_name.buf)) + if (safe_create_leading_directories(r, midx_name.buf)) die_errno(_("unable to create leading directories of %s"), midx_name.buf); |
