object-file: move mkdir_in_gitdir() into "path.c"
The `mkdir_in_gitdir()` function is similar to `safe_create_dir()`, but
the former is hosted in "object-file.c" whereas the latter is hosted in
"path.c". The latter code unit makes way more sense though as the logic
has nothing to do with object files in particular.
Move the file into "path.c". While at it, we:
- Rename the function to `safe_create_dir_in_gitdir()` so that the
function names are similar to one another.
- Remove the dependency on `the_repository` by making the callers pass
the repository instead.
Adjust callers accordingly.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
0dfca98881
commit
d1fa670de0
@@ -54,8 +54,6 @@ enum scld_error safe_create_leading_directories(char *path);
|
||||
enum scld_error safe_create_leading_directories_const(const char *path);
|
||||
enum scld_error safe_create_leading_directories_no_share(char *path);
|
||||
|
||||
int mkdir_in_gitdir(const char *path);
|
||||
|
||||
int git_open_cloexec(const char *name, int flags);
|
||||
#define git_open(name) git_open_cloexec(name, O_RDONLY)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user