Skip to content

Commit f890db8

Browse files
mhaggergitster
authored andcommitted
do_for_each_entry_in_dir(): delete function
Its only remaining caller was itself. Signed-off-by: Michael Haggerty <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 50c2d85 commit f890db8

File tree

2 files changed

+0
-32
lines changed

2 files changed

+0
-32
lines changed

refs/ref-cache.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -316,27 +316,6 @@ static void sort_ref_dir(struct ref_dir *dir)
316316
dir->sorted = dir->nr = i;
317317
}
318318

319-
int do_for_each_entry_in_dir(struct ref_dir *dir,
320-
each_ref_entry_fn fn, void *cb_data)
321-
{
322-
int i;
323-
assert(dir->sorted == dir->nr);
324-
for (i = 0; i < dir->nr; i++) {
325-
struct ref_entry *entry = dir->entries[i];
326-
int retval;
327-
if (entry->flag & REF_DIR) {
328-
struct ref_dir *subdir = get_ref_dir(entry);
329-
sort_ref_dir(subdir);
330-
retval = do_for_each_entry_in_dir(subdir, fn, cb_data);
331-
} else {
332-
retval = fn(entry, cb_data);
333-
}
334-
if (retval)
335-
return retval;
336-
}
337-
return 0;
338-
}
339-
340319
/*
341320
* Load all of the refs from `dir` (recursively) into our in-memory
342321
* cache.

refs/ref-cache.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -251,17 +251,6 @@ struct ref_iterator *cache_ref_iterator_begin(struct ref_cache *cache,
251251
const char *prefix,
252252
int prime_dir);
253253

254-
typedef int each_ref_entry_fn(struct ref_entry *entry, void *cb_data);
255-
256-
/*
257-
* Call `fn` for each reference in `dir`. Recurse into subdirectories,
258-
* sorting them before iterating. This function does not sort `dir`
259-
* itself; it should be sorted beforehand. `fn` is called for all
260-
* references, including broken ones.
261-
*/
262-
int do_for_each_entry_in_dir(struct ref_dir *dir,
263-
each_ref_entry_fn fn, void *cb_data);
264-
265254
/*
266255
* Peel the entry (if possible) and return its new peel_status. If
267256
* repeel is true, re-peel the entry even if there is an old peeled

0 commit comments

Comments
 (0)