aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/credential-cache--daemon.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2025-04-15 11:38:15 +0200
committerJunio C Hamano <gitster@pobox.com>2025-04-15 08:24:35 -0700
commit1a99fe8010642a71063536510c578c1543d763b4 (patch)
tree1151da975bf092257d71b0c4420056265e9be0f8 /builtin/credential-cache--daemon.c
parentd1fa670de07ec9d08fc1333b3addf746c7d304e2 (diff)
downloadgit-1a99fe8010642a71063536510c578c1543d763b4.tar.gz
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/credential-cache--daemon.c')
-rw-r--r--builtin/credential-cache--daemon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c
index e707618e74..5065ff4660 100644
--- a/builtin/credential-cache--daemon.c
+++ b/builtin/credential-cache--daemon.c
@@ -2,8 +2,8 @@
#include "builtin.h"
#include "abspath.h"
#include "gettext.h"
-#include "object-file.h"
#include "parse-options.h"
+#include "path.h"
#ifndef NO_UNIX_SOCKETS
@@ -271,7 +271,7 @@ static void init_socket_directory(const char *path)
* condition in which somebody can chdir to it, sleep, then try to open
* our protected socket.
*/
- if (safe_create_leading_directories_const(dir) < 0)
+ if (safe_create_leading_directories_const(the_repository, dir) < 0)
die_errno("unable to create directories for '%s'", dir);
if (mkdir(dir, 0700) < 0)
die_errno("unable to mkdir '%s'", dir);