Merge branch 'dt/refs-backend-pre-vtable'
Code preparation for pluggable ref backends. * dt/refs-backend-pre-vtable: refs: break out ref conflict checks files_log_ref_write: new function initdb: make safe_create_dir public refs: split filesystem-based refs code into a new file refs/refs-internal.h: new header file refname_is_safe(): improve docstring pack_if_possible_fn(): use ref_type() instead of is_per_worktree_ref() copy_msg(): rename to copy_reflog_msg() verify_refname_available(): new function verify_refname_available(): rename function
This commit is contained in:
12
path.c
12
path.c
@ -740,6 +740,18 @@ int adjust_shared_perm(const char *path)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void safe_create_dir(const char *dir, int share)
|
||||
{
|
||||
if (mkdir(dir, 0777) < 0) {
|
||||
if (errno != EEXIST) {
|
||||
perror(dir);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
else if (share && adjust_shared_perm(dir))
|
||||
die(_("Could not make %s writable by group"), dir);
|
||||
}
|
||||
|
||||
static int have_same_root(const char *path1, const char *path2)
|
||||
{
|
||||
int is_abs1, is_abs2;
|
||||
|
||||
Reference in New Issue
Block a user