ref-cache: remove unused function 'find_ref_entry()'
The 'find_ref_entry' function is no longer used, so remove it. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Karthik Nayak committed
Jul 15, 2025 at 13:28 UTC
883a7ea0543426d0ecb172c72c8f706348961605
2 files changed
-21
refs/ref-cache.c
-14
@@ -194,20 +194,6 @@ static struct ref_dir *find_containing_dir(struct ref_dir *dir,
194
return dir;
195
}
196
197
-struct ref_entry *find_ref_entry(struct ref_dir *dir, const char *refname)
198
-{
199
- int entry_index;
200
- struct ref_entry *entry;
201
- dir = find_containing_dir(dir, refname);
202
- if (!dir)
203
- return NULL;
204
- entry_index = search_ref_dir(dir, refname, strlen(refname));
205
- if (entry_index == -1)
206
- return NULL;
207
- entry = dir->entries[entry_index];
208
- return (entry->flag & REF_DIR) ? NULL : entry;
209
-}
210
-
197
/*
198
* Emit a warning and return true iff ref1 and ref2 have the same name
199
* and the same oid. Die if they have the same name but different
refs/ref-cache.h
-7
@@ -201,13 +201,6 @@ void free_ref_cache(struct ref_cache *cache);
201
*/
202
void add_entry_to_dir(struct ref_dir *dir, struct ref_entry *entry);
203
204
-/*
205
- * Find the value entry with the given name in dir, sorting ref_dirs
206
- * and recursing into subdirectories as necessary. If the name is not
207
- * found or it corresponds to a directory entry, return NULL.
208
- */
209
-struct ref_entry *find_ref_entry(struct ref_dir *dir, const char *refname);
210
-
204
/*
205
* Start iterating over references in `cache`. If `prefix` is
206
* specified, only include references whose names start with that