for-each-ref: Do not lookup objects when they will not be used
[gitweb.git] / transport.c
index 3dfb03c06ed82102f60045d6889db97cf036651e..efecb65258ba95ee743f0e3ca178e74e2756e7d1 100644 (file)
@@ -1069,7 +1069,7 @@ int transport_fetch_refs(struct transport *transport, const struct ref *refs)
 void transport_unlock_pack(struct transport *transport)
 {
        if (transport->pack_lockfile) {
-               unlink(transport->pack_lockfile);
+               unlink_or_warn(transport->pack_lockfile);
                free(transport->pack_lockfile);
                transport->pack_lockfile = NULL;
        }