diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-03-05 14:34:32 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-03-05 14:34:32 +0200 |
commit | 55ffebe37768b2b839f5501f76e77e89d9f91882 (patch) | |
tree | c9275716290855fd909df22c4163bf7797da02b8 /src/filebuf.c | |
parent | 246eba80af31d25a1fb14e707f79374cf91f8bb7 (diff) | |
download | libgit2-55ffebe37768b2b839f5501f76e77e89d9f91882.tar.gz |
Fix creation of deeply-rooted references
Use a new `gitfo_creat_force` that will create the full path to a file
before creating it.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/filebuf.c')
-rw-r--r-- | src/filebuf.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/filebuf.c b/src/filebuf.c index 73f0a70f4..4fc4f1486 100644 --- a/src/filebuf.c +++ b/src/filebuf.c @@ -39,7 +39,12 @@ static int lock_file(git_filebuf *file, int flags) return GIT_EOSERR; } - file->fd = gitfo_creat(file->path_lock, 0644); + /* create path to the file buffer is required */ + if (flags & GIT_FILEBUF_FORCE) { + file->fd = gitfo_creat_force(file->path_lock, 0644); + } else { + file->fd = gitfo_creat(file->path_lock, 0644); + } if (file->fd < 0) return GIT_EOSERR; |