summaryrefslogtreecommitdiff
path: root/src/reflog.c
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2012-10-03 15:12:42 +0200
committernulltoken <emeric.fermas@gmail.com>2012-10-26 21:02:00 +0200
commit27e3c58392a53a66a4b914d570a0af87a3a58c68 (patch)
treebad6f5da58c377860c66b1ba2978c889bc17d8df /src/reflog.c
parentd2aa6de7224552f648887950fec8c2f55629526d (diff)
downloadlibgit2-27e3c58392a53a66a4b914d570a0af87a3a58c68.tar.gz
reflog: create reflog and its directory structure
Diffstat (limited to 'src/reflog.c')
-rw-r--r--src/reflog.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/reflog.c b/src/reflog.c
index 3c780cd1e..17cd6d93f 100644
--- a/src/reflog.c
+++ b/src/reflog.c
@@ -188,7 +188,10 @@ static int retrieve_reflog_path(git_buf *path, git_reference *ref)
static int create_new_reflog_file(const char *filepath)
{
- int fd;
+ int fd, error;
+
+ if ((error = git_futils_mkpath2file(filepath, GIT_REFLOG_DIR_MODE)) < 0)
+ return error;
if ((fd = p_open(filepath,
O_WRONLY | O_CREAT | O_TRUNC,