do_for_each_entry_in_dir(): delete function
Its only remaining caller was itself. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Michael Haggerty committed
Apr 16, 2017 at 08:41 UTC
f890db83ee426f4bda0458728e813e45cc8531a7
2 files changed
-32
refs/ref-cache.c
-21
@@ -316,27 +316,6 @@ static void sort_ref_dir(struct ref_dir *dir)
316
dir->sorted = dir->nr = i;
317
}
318
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
-
319
/*
320
* Load all of the refs from `dir` (recursively) into our in-memory
321
* cache.
refs/ref-cache.h
-11
@@ -251,17 +251,6 @@ struct ref_iterator *cache_ref_iterator_begin(struct ref_cache *cache,
251
const char *prefix,
252
int prime_dir);
253
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
-
254
/*
255
* Peel the entry (if possible) and return its new peel_status. If
256
* repeel is true, re-peel the entry even if there is an old peeled