diff options
| author | Edward Thomson <ethomson@microsoft.com> | 2015-09-16 15:07:27 -0400 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2015-09-17 10:00:35 -0400 |
| commit | ac2fba0ecd68e8eae348dec688cbcd0828432cdf (patch) | |
| tree | 35921227c4eae6e36a65a90e391966319d9676b2 /src/refdb_fs.c | |
| parent | add0378d8eb76cb7fde92bcbed3eb59ee5b8947c (diff) | |
| download | libgit2-ac2fba0ecd68e8eae348dec688cbcd0828432cdf.tar.gz | |
git_futils_mkdir_*: make a relative-to-base mkdir
Untangle git_futils_mkdir from git_futils_mkdir_ext - the latter
assumes that we own everything beneath the base, as if it were
being called with a base of the repository or working directory,
and is tailored towards checkout and ensuring that there is no
bogosity beneath the base that must be cleaned up.
This is (at best) slow and (at worst) unsafe in the larger context
of a filesystem where we do not own things and cannot do things like
unlink symlinks that are in our way.
Diffstat (limited to 'src/refdb_fs.c')
| -rw-r--r-- | src/refdb_fs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/refdb_fs.c b/src/refdb_fs.c index 1ddce4649..921f7862b 100644 --- a/src/refdb_fs.c +++ b/src/refdb_fs.c @@ -1413,7 +1413,8 @@ static int setup_namespace(git_buf *path, git_repository *repo) git__free(parts); /* Make sure that the folder with the namespace exists */ - if (git_futils_mkdir_r(git_buf_cstr(path), repo->path_repository, 0777) < 0) + if (git_futils_mkdir_relative(git_buf_cstr(path), repo->path_repository, + 0777, GIT_MKDIR_PATH, NULL) < 0) return -1; /* Return root of the namespaced path, i.e. without the trailing '/refs' */ |
