From patchwork Wed May 19 19:13:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Steinhardt X-Patchwork-Id: 12268269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86059C433B4 for ; Wed, 19 May 2021 19:13:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6464A6135A for ; Wed, 19 May 2021 19:13:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231932AbhESTO7 (ORCPT ); Wed, 19 May 2021 15:14:59 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:46641 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230499AbhESTOx (ORCPT ); Wed, 19 May 2021 15:14:53 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 12B9C5C0198 for ; Wed, 19 May 2021 15:13:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Wed, 19 May 2021 15:13:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=fm1; bh=3w9UTEi5ughA1WPCjA7SpmfmOlIHVDVAYUWX2MEM hPE=; b=eA2zz1zT++Br51tUxbgsehwCbPzlfwsfFk69FckBkbmV0C5NJVdwCUFf TWET5GHkKpT80LP3oS8udf04KHEjdAR1qTqLhZoAI7JXuN+RzYnqfEhbdukGWhRJ WYx7kPlG45wB5FGCme+HkvQyX6ph5S0ZN+78uFyCMXXRVb2x8V7o+fzqjit8zJ5S RMyv/9lknY9xgsNlBmZUbo1VF14jjVUMWaOLYgQDp5aqERcONbMjYz1NTRqTql3V ElqUoFJvtQwJUVrSV8WOevah3BnxgIb/XBdB1RO4aVmu9u/hTs4Y086eGVTPFZlM 52iyTufFWiN083vvFFRPtUliFTM9pg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=3w9UTE i5ughA1WPCjA7SpmfmOlIHVDVAYUWX2MEMhPE=; b=sVN6byB311SfBulFy9UltB gYReynn65OIbrBTWBl6cB5F9HHZ1XrXUYf6kmc9h6fsUi4pSTFyEPc2E7owL3k1P oO7B1t1QXncnfI5JmA0M3AMqVpU9+401EjyQxwCxpeyOfgZ2wuaZalGTXHOmAiB2 Fo+hGyCuR3A7VEwPb5d3pB49ELKCnTPfs20kzIFGZMhjrot5GivE/G/8kfzBFetW 9b//GMbIhWbUkwenV3U7QddfmJUiDzV9ihYlT35aJy0+Xq59NBYbWfO030qq0pBX SucSMaHCpm2vl32BYiTESbNC2kZTvKABAdHTydIiGQnMdgj4aiDJjiXGDsw29T4Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeiledgudefudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtuggjsehgtd erredttddvnecuhfhrohhmpefrrghtrhhitghkucfuthgvihhnhhgrrhguthcuoehpshes phhkshdrihhmqeenucggtffrrghtthgvrhhnpeehgefhtdefueffheekgfffudelffejtd fhvdejkedthfehvdelgfetgfdvtedthfenucfkphepjeejrddukeefrdefjedrudehieen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpshesph hkshdrihhm X-ME-Proxy: Received: from vm-mail.pks.im (x4db7259c.dyn.telefonica.de [77.183.37.156]) by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 19 May 2021 15:13:32 -0400 (EDT) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 61a9e053 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 19 May 2021 19:13:32 +0000 (UTC) Date: Wed, 19 May 2021 21:13:31 +0200 From: Patrick Steinhardt To: git@vger.kernel.org Subject: [PATCH 3/8] tmp-objdir: expose function to retrieve path Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org It's currently impossible to tell the path of a temporary object directory for outside users of `struct tmp_objdir`. We'll soon need that information though so that we can reuse information from the quarantine environment in git-receive-pack(1). Provide a new function `tmp_objdir_path()` which returns the path of a temporary object directory to prepare for this. Signed-off-by: Patrick Steinhardt --- tmp-objdir.c | 7 +++++++ tmp-objdir.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/tmp-objdir.c b/tmp-objdir.c index b8d880e362..6056917c63 100644 --- a/tmp-objdir.c +++ b/tmp-objdir.c @@ -288,6 +288,13 @@ const char **tmp_objdir_env(const struct tmp_objdir *t) return t->env.v; } +const char *tmp_objdir_path(const struct tmp_objdir *t) +{ + if (!t) + return NULL; + return t->path.buf; +} + void tmp_objdir_add_as_alternate(const struct tmp_objdir *t) { add_to_alternates_memory(t->path.buf); diff --git a/tmp-objdir.h b/tmp-objdir.h index b1e45b4c75..da3ccb98bc 100644 --- a/tmp-objdir.h +++ b/tmp-objdir.h @@ -51,4 +51,9 @@ int tmp_objdir_destroy(struct tmp_objdir *); */ void tmp_objdir_add_as_alternate(const struct tmp_objdir *); +/* + * Return the path of the temporary object directory. + */ +const char *tmp_objdir_path(const struct tmp_objdir *t); + #endif /* TMP_OBJDIR_H */