refs.c: call lock_ref_sha1_basic directly from commit
authorRonnie Sahlberg <sahlberg@google.com>
Thu, 1 May 2014 17:43:39 +0000 (10:43 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 15 Oct 2014 17:47:23 +0000 (10:47 -0700)
Skip using the lock_any_ref_for_update wrapper and call lock_ref_sha1_basic
directly from the commit function.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
diff --git a/refs.c b/refs.c
index 9c0162378f932d38de0c426d6eef89c538b40b6e..b591b9c32173849fbd3c387420cfb3434bfad211 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -3632,12 +3632,12 @@ int ref_transaction_commit(struct ref_transaction *transaction,
        for (i = 0; i < n; i++) {
                struct ref_update *update = updates[i];
 
-               update->lock = lock_any_ref_for_update(update->refname,
-                                                      (update->have_old ?
-                                                       update->old_sha1 :
-                                                       NULL),
-                                                      update->flags,
-                                                      &update->type);
+               update->lock = lock_ref_sha1_basic(update->refname,
+                                                  (update->have_old ?
+                                                   update->old_sha1 :
+                                                   NULL),
+                                                  update->flags,
+                                                  &update->type);
                if (!update->lock) {
                        if (err)
                                strbuf_addf(err, "Cannot lock the ref '%s'.",