gitweb: Convert project name to UTF-8
[gitweb.git] / refs.c
diff --git a/refs.c b/refs.c
index da09e434c7ac5dfceebc6a2ffd85e57eaeb75eef..03e8dfec9fcb2c9fffc7c809048fa90a0e02b0af 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -663,6 +663,8 @@ struct ref_lock *lock_ref_sha1(const char *ref, const unsigned char *old_sha1)
 
 struct ref_lock *lock_any_ref_for_update(const char *ref, const unsigned char *old_sha1)
 {
+       if (check_ref_format(ref) == -1)
+               return NULL;
        return lock_ref_sha1_basic(ref, old_sha1, NULL);
 }