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/odb_loose.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/odb_loose.c')
-rw-r--r-- | src/odb_loose.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/odb_loose.c b/src/odb_loose.c index 99b8f7c91..730c4b1e1 100644 --- a/src/odb_loose.c +++ b/src/odb_loose.c @@ -84,9 +84,9 @@ static int object_file_name( static int object_mkdir(const git_buf *name, const loose_backend *be) { - return git_futils_mkdir( + return git_futils_mkdir_relative( name->ptr + be->objects_dirlen, be->objects_dir, be->object_dir_mode, - GIT_MKDIR_PATH | GIT_MKDIR_SKIP_LAST | GIT_MKDIR_VERIFY_DIR); + GIT_MKDIR_PATH | GIT_MKDIR_SKIP_LAST | GIT_MKDIR_VERIFY_DIR, NULL); } static size_t get_binary_object_header(obj_hdr *hdr, git_buf *obj) |