From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jonathan Nieder Subject: [PATCH 08/24] refs.c: call lock_ref_sha1_basic directly from commit Date: Wed, 1 Oct 2014 19:02:07 -0700 Message-ID: <20141002020207.GA1175@google.com> References: <20140820231723.GF20185@google.com> <20140911030318.GD18279@google.com> <20141002014817.GS1175@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: "git@vger.kernel.org" , Michael Haggerty To: Ronnie Sahlberg X-From: git-owner@vger.kernel.org Thu Oct 02 04:02:16 2014 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XZVii-0007Lu-CT for gcvg-git-2@plane.gmane.org; Thu, 02 Oct 2014 04:02:16 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754196AbaJBCCL (ORCPT ); Wed, 1 Oct 2014 22:02:11 -0400 Received: from mail-pa0-f45.google.com ([209.85.220.45]:42865 "EHLO mail-pa0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753300AbaJBCCK (ORCPT ); Wed, 1 Oct 2014 22:02:10 -0400 Received: by mail-pa0-f45.google.com with SMTP id rd3so1365276pab.4 for ; Wed, 01 Oct 2014 19:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=mNDmGe0QbV8GnBjfT3iu5OiLJZ36P257ISyxSdk/amA=; b=REXBULa+E1lTpB46bpQjbh/lco5ROqmZ8Isyr6jmILWMHuo9EmveAUp62/YLhKGl3j caA75aQFWThzKKFoxxftDy5Q1LMOJtu1DW4GNa6roG/0elPjDVcw2UTXtUcrW5LNmP14 +Rh91my8hyGYeAxW0nrfINzcL1SAor5cNy2gnbUz8kaWfwKhTd8g0rBx/HsyVrx3OL5k m+V8YOz2uRkSGTx86kYdyToVPKynx1dZv4uGGMHRPuBAZoOkZLIfC48pIy7EswwxhR8N 8L1Vr2gV835aEqOhJ402beApWnDYraRyEssRhHd+2MILYFjpwdZQ4mI6mPYcgkhzHjAY j6iw== X-Received: by 10.68.135.35 with SMTP id pp3mr605529pbb.145.1412215330231; Wed, 01 Oct 2014 19:02:10 -0700 (PDT) Received: from google.com (aiede.mtv.corp.google.com [172.27.69.120]) by mx.google.com with ESMTPSA id qf3sm2024287pbc.96.2014.10.01.19.02.08 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 01 Oct 2014 19:02:09 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20141002014817.GS1175@google.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: From: Ronnie Sahlberg Date: Thu, 1 May 2014 10:43:39 -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 Signed-off-by: Jonathan Nieder Reviewed-by: Michael Haggerty --- As before. refs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/refs.c b/refs.c index 3c2ce57..f124c2b 100644 --- a/refs.c +++ b/refs.c @@ -3578,12 +3578,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'.", -- 2.1.0.rc2.206.gedb03e5