From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id 918D81F626 for ; Fri, 24 Feb 2023 06:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229756AbjBXGer (ORCPT ); Fri, 24 Feb 2023 01:34:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229750AbjBXGeq (ORCPT ); Fri, 24 Feb 2023 01:34:46 -0500 Received: from cloud.peff.net (cloud.peff.net [104.130.231.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78BE51589C for ; Thu, 23 Feb 2023 22:34:45 -0800 (PST) Received: (qmail 3649 invoked by uid 109); 24 Feb 2023 06:34:45 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Fri, 24 Feb 2023 06:34:45 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 31044 invoked by uid 111); 24 Feb 2023 06:34:44 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Fri, 24 Feb 2023 01:34:44 -0500 Authentication-Results: peff.net; auth=none Date: Fri, 24 Feb 2023 01:34:44 -0500 From: Jeff King To: git@vger.kernel.org Subject: [PATCH 01/21] ref-filter: drop unused atom parameter from get_worktree_path() Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The get_worktree_path() function is used to populate the %(worktreepath) value, but it has never used its "atom" parameter since it was added in 2582083fa1 (ref-filter: add worktreepath atom, 2019-04-28). Normally we'd use the atom struct to cache any work we do, but in this case there's a global hashmap that does that caching already. So we can just drop the unused parameter. Signed-off-by: Jeff King --- ref-filter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ref-filter.c b/ref-filter.c index f8203c6b05..434a28c830 100644 --- a/ref-filter.c +++ b/ref-filter.c @@ -1822,7 +1822,7 @@ static void lazy_init_worktree_map(void) populate_worktree_map(&(ref_to_worktree_map.map), ref_to_worktree_map.worktrees); } -static char *get_worktree_path(const struct used_atom *atom, const struct ref_array_item *ref) +static char *get_worktree_path(const struct ref_array_item *ref) { struct hashmap_entry entry, *e; struct ref_to_worktree_entry *lookup_result; @@ -1881,7 +1881,7 @@ static int populate_value(struct ref_array_item *ref, struct strbuf *err) refname = get_refname(atom, ref); else if (atom_type == ATOM_WORKTREEPATH) { if (ref->kind == FILTER_REFS_BRANCHES) - v->s = get_worktree_path(atom, ref); + v->s = get_worktree_path(ref); else v->s = xstrdup(""); continue; -- 2.39.2.981.g6157336f25