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 /builtin/init-db.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 'builtin/init-db.c')
| -rw-r--r-- | builtin/init-db.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/init-db.c b/builtin/init-db.c index 196dccdd77..91c2563e34 100644 --- a/builtin/init-db.c +++ b/builtin/init-db.c @@ -8,7 +8,6 @@ #include "abspath.h" #include "environment.h" #include "gettext.h" -#include "object-file.h" #include "parse-options.h" #include "path.h" #include "refs.h" @@ -134,7 +133,7 @@ int cmd_init_db(int argc, */ saved = repo_settings_get_shared_repository(the_repository); repo_settings_set_shared_repository(the_repository, 0); - switch (safe_create_leading_directories_const(argv[0])) { + switch (safe_create_leading_directories_const(the_repository, argv[0])) { case SCLD_OK: case SCLD_PERMS: break; |
