From: Phil Hord <phil.hord@gmail.com>
To: gitster@pobox.com
Cc: peff@peff.net, git@vger.kernel.org,
Jacob Keller <jacob.e.keller@intel.com>,
Phil Hord <phil.hord@gmail.com>
Subject: [PATCH v2 2/2] refs: remove old refs_warn_dangling_symref
Date: Mon, 23 Jun 2025 16:43:27 -0700 [thread overview]
Message-ID: <20250623234327.335490-3-phil.hord@gmail.com> (raw)
In-Reply-To: <20250623234327.335490-1-phil.hord@gmail.com>
From: Phil Hord <phil.hord@gmail.com>
The dangling warning function that takes a single ref to search for
is no longer used. Remove it.
Signed-off-by: Phil Hord <phil.hord@gmail.com>
---
refs.c | 17 +----------------
1 file changed, 1 insertion(+), 16 deletions(-)
diff --git a/refs.c b/refs.c
index e2075a98c844..a9fbb0c8f23c 100644
--- a/refs.c
+++ b/refs.c
@@ -438,7 +438,6 @@ static int for_each_filter_refs(const char *refname, const char *referent,
struct warn_if_dangling_data {
struct ref_store *refs;
FILE *fp;
- const char *refname;
const struct string_list *refnames;
const char *msg_fmt;
};
@@ -455,9 +454,7 @@ static int warn_if_dangling_symref(const char *refname, const char *referent UNU
resolves_to = refs_resolve_ref_unsafe(d->refs, refname, 0, NULL, NULL);
if (!resolves_to
- || (d->refname
- ? strcmp(resolves_to, d->refname)
- : !string_list_has_string(d->refnames, resolves_to))) {
+ || !string_list_has_string(d->refnames, resolves_to)) {
return 0;
}
@@ -468,18 +465,6 @@ static int warn_if_dangling_symref(const char *refname, const char *referent UNU
return 0;
}
-void refs_warn_dangling_symref(struct ref_store *refs, FILE *fp,
- const char *msg_fmt, const char *refname)
-{
- struct warn_if_dangling_data data = {
- .refs = refs,
- .fp = fp,
- .refname = refname,
- .msg_fmt = msg_fmt,
- };
- refs_for_each_rawref(refs, warn_if_dangling_symref, &data);
-}
-
void refs_warn_dangling_symrefs(struct ref_store *refs, FILE *fp,
const char *msg_fmt, const struct string_list *refnames)
{
--
2.50.0.84.g5d85fe910b.dirty
prev parent reply other threads:[~2025-06-23 23:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-23 23:43 [PATCH v2 0/2] fetch --prune performance problem Phil Hord
2025-06-23 23:43 ` [PATCH v2 1/2] fetch-prune: optimize dangling-ref reporting Phil Hord
2025-06-24 10:49 ` Jeff King
2025-06-23 23:43 ` Phil Hord [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250623234327.335490-3-phil.hord@gmail.com \
--to=phil.hord@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jacob.e.keller@intel.com \
--cc=peff@peff.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox