http-push: fail when info/refs exists and is already locked
[gitweb.git] / http-push.c
index 2c4e91d8749ba255d17713df5129487c330bbb93..e1984d3a0036d2852d13f2a4e0cfd0c61ea66c07 100644 (file)
@@ -2243,6 +2243,11 @@ int main(int argc, char **argv)
                info_ref_lock = lock_remote("info/refs", LOCK_TIME);
                if (info_ref_lock)
                        remote->can_update_info_refs = 1;
+               else {
+                       fprintf(stderr, "Error: cannot lock existing info/refs\n");
+                       rc = 1;
+                       goto cleanup;
+               }
        }
        if (remote->has_info_packs)
                fetch_indices();