summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/refdb_fs.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index 6d8c76236..c550ee92a 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -733,8 +733,11 @@ static int loose_lock(git_filebuf *file, refdb_fs_backend *backend, const char *
error = git_filebuf_open(file, ref_path.ptr, GIT_FILEBUF_FORCE, GIT_REFS_FILE_MODE);
+ if (error == GIT_EDIRECTORY)
+ giterr_set(GITERR_REFERENCE, "cannot lock ref '%s', there are refs beneath that folder", name);
+
git_buf_free(&ref_path);
- return error;
+ return error;
}
static int loose_commit(git_filebuf *file, const git_reference *ref)