Merge branch 'ar/unlink-err' into maint
[gitweb.git] / refs.c
diff --git a/refs.c b/refs.c
index 2b1f0f0e6ed7978107e5b488f8d12f6276e482a4..90163bdc56868151e4fd45ff77aa3bd56db45573 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -893,8 +893,10 @@ static struct ref_lock *lock_ref_sha1_basic(const char *ref, const unsigned char
         * name is a proper prefix of our refname.
         */
        if (missing &&
-            !is_refname_available(ref, NULL, get_packed_refs(), 0))
+            !is_refname_available(ref, NULL, get_packed_refs(), 0)) {
+               last_errno = ENOTDIR;
                goto error_return;
+       }
 
        lock->lk = xcalloc(1, sizeof(struct lock_file));