refs.c: call lock_ref_sha1_basic directly from commit
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>
Ronnie Sahlberg committed
May 1, 2014 at 10:43 UTC
5d94a1b03318d14847a40f233560c2a87fb16cfa
1 file changed
+6
-6
refs.c
+6
-6
@@ -3632,12 +3632,12 @@ int ref_transaction_commit(struct ref_transaction *transaction,
3632
for (i = 0; i < n; i++) {
3633
struct ref_update *update = updates[i];
3634
3635
- update->lock = lock_any_ref_for_update(update->refname,
3636
- (update->have_old ?
3637
- update->old_sha1 :
3638
- NULL),
3639
- update->flags,
3640
- &update->type);
3635
+ update->lock = lock_ref_sha1_basic(update->refname,
3636
+ (update->have_old ?
3637
+ update->old_sha1 :
3638
+ NULL),
3639
+ update->flags,
3640
+ &update->type);
3641
if (!update->lock) {
3642
if (err)
3643
strbuf_addf(err, "Cannot lock the ref '%s'.",