From patchwork Thu May 16 08:05:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 13665818 Received: from fhigh2-smtp.messagingengine.com (fhigh2-smtp.messagingengine.com [103.168.172.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 85DA471739 for ; Thu, 16 May 2024 08:05:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.153 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715846728; cv=none; b=IQvMQ5O5NkOoWNEBUd20fn/dbuavJKdR8VqisTm9MbtIUE/W/Ubw614MRPPDsPdl/TAhlbQLXFLrMasNolq0KEX75Ey0W24bbyesmHRTSPViekKXX7spwgFYW8QVp3OaIwZnE9eI56uNoNvL0Rs3H4qUq2VSMmZVfPFPzNQAqpY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715846728; c=relaxed/simple; bh=gHrD8PHPX2sGKJGC6lFYmlwsKp97qFOOnZQjWn33akc=; h=Date:From:To:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PwRtgRS2rQEnXeWlI0FfeoxE2uED+KZVSiWZg7V5/hqWJ9389xbwMarJzlf7vUvWG7mGrU9toVbNIxWbJucLK9yVhnl++LVlfEzkiYd9ntbn/d0CR/EOy8i0gNCJR5PoJqvxITacO80SX+JsI326lo7UEpb7fsrA2p3zHD63lQY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b=dB1QaVWr; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=fD2mhAPG; arc=none smtp.client-ip=103.168.172.153 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pks.im header.i=@pks.im header.b="dB1QaVWr"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="fD2mhAPG" Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailfhigh.nyi.internal (Postfix) with ESMTP id D0D2611400C8 for ; Thu, 16 May 2024 04:05:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 16 May 2024 04:05:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1715846726; x=1715933126; bh=s6kcr1QYKI Pzm7Vnx+gA/IjC5xrEfZwZdAlB0yDOJjg=; b=dB1QaVWrMawY/PctUCTEruXVTq u02CNpYyzdKeoYYd7IUw1SUgoSTYu6y05Urlxh3LECpVAr2N4o4IQoisXaxAP4sZ ekRR2PNirv+IcX+NVO/eKEo9OupTgRTsDXm94D3uwlhgEBIUHyghDv5HwL5GarJj SRm9cM7rXTwFrchhfSJL3/NUc3/0UPtZa/4ilthTAXH6+cFQfmlvf8YYtdBmndUs sOgpn3Z3iV50WW4S9mguEZYlxGu0NdbBFGBxzCZ7IfuKQYCLZb7vAuDcsZHpZzzh 7Mir2Op9EhABSM/nyQHgpkerMRG6fk0PhUbaWF86c1+MJIMd5GAKOrNG5Q3Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1715846726; x=1715933126; bh=s6kcr1QYKIPzm7Vnx+gA/IjC5xrE fZwZdAlB0yDOJjg=; b=fD2mhAPGHJO5TtfDCn+7kJPk7qdtDvTw4S6nrrsjzy7C aWpDIyvqSIzGP68k87QxxLlm/pnw1D4zN2D3lcM7u63e1NtboVO38CXkx4Ik0ZqQ MIXvKcayEKUxwFh1lhX/bZ6/4Cif1FFUg6B/ZdhqU3iwt6Mr35ifdcVzJbGSIjwZ aiUQDGbV2LLtII1n0CRk6NXqa33jpJcQZVPJVC4QzBrq2qfQ/eLI5wk+9+v3ikAW VZruHtwJUlLjTcFMi5+3o8SPjCSKk40NWJ59t9guHWyNbmukOtUa3UemF8BvgiF9 +l8gVWUr7thT8fCGHZHem0Kp5rXeg+xo/0naQ6w9uQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehtddgtdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvuffkfhggtggujgesghdtre ertddtvdenucfhrhhomheprfgrthhrihgtkhcuufhtvghinhhhrghrughtuceophhssehp khhsrdhimheqnecuggftrfgrthhtvghrnhepheeghfdtfeeuffehkefgffduleffjedthf dvjeektdfhhedvlefgtefgvdettdfhnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Thu, 16 May 2024 04:05:26 -0400 (EDT) Received: by localhost (OpenSMTPD) with ESMTPSA id ea7d4bee (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Thu, 16 May 2024 08:05:01 +0000 (UTC) Date: Thu, 16 May 2024 10:05:24 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 15/16] refs/files: remove references to `the_hash_algo` Message-ID: References: Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Remove references to `the_hash_algo` in favor of the hash algo specified by the repository associated with the files ref store. Signed-off-by: Patrick Steinhardt --- refs/files-backend.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 5294282770..5684f1bfc6 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -1822,7 +1822,7 @@ static int write_ref_to_lockfile(struct files_ref_store *refs, } } fd = get_lock_file_fd(&lock->lk); - if (write_in_full(fd, oid_to_hex(oid), the_hash_algo->hexsz) < 0 || + if (write_in_full(fd, oid_to_hex(oid), refs->base.repo->hash_algo->hexsz) < 0 || write_in_full(fd, &term, 1) < 0 || fsync_component(FSYNC_COMPONENT_REFERENCE, get_lock_file_fd(&lock->lk)) < 0 || close_ref_gently(lock) < 0) { @@ -3223,7 +3223,7 @@ static int files_reflog_expire(struct ref_store *ref_store, rollback_lock_file(&reflog_lock); } else if (update && (write_in_full(get_lock_file_fd(&lock->lk), - oid_to_hex(&cb.last_kept_oid), the_hash_algo->hexsz) < 0 || + oid_to_hex(&cb.last_kept_oid), refs->base.repo->hash_algo->hexsz) < 0 || write_str_in_full(get_lock_file_fd(&lock->lk), "\n") < 0 || close_ref_gently(lock) < 0)) { status |= error("couldn't write %s",