tree-wide: remove unused functions We have some functions which aren't used anywhere. Let's remove them to get rid of unneeded baggage.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
diff --git a/src/cache.c b/src/cache.c
index af42b39..1d2c015 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -41,27 +41,6 @@ int git_cache_set_max_object_size(git_object_t type, size_t size)
return 0;
}
-void git_cache_dump_stats(git_cache *cache)
-{
- git_cached_obj *object;
-
- if (git_cache_size(cache) == 0)
- return;
-
- printf("Cache %p: %"PRIuZ" items cached, %"PRIdZ" bytes\n",
- cache, git_cache_size(cache), cache->used_memory);
-
- git_oidmap_foreach_value(cache->map, object, {
- char oid_str[9];
- printf(" %s%c %s (%"PRIuZ")\n",
- git_object_type2string(object->type),
- object->flags == GIT_CACHE_STORE_PARSED ? '*' : ' ',
- git_oid_tostr(oid_str, sizeof(oid_str), &object->oid),
- object->size
- );
- });
-}
-
int git_cache_init(git_cache *cache)
{
memset(cache, 0, sizeof(*cache));
diff --git a/src/diff.c b/src/diff.c
index 47f49d9..efbedb5 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -32,11 +32,6 @@ GIT_INLINE(const char *) diff_delta__path(const git_diff_delta *delta)
return str;
}
-const char *git_diff_delta__path(const git_diff_delta *delta)
-{
- return diff_delta__path(delta);
-}
-
int git_diff_delta__cmp(const void *a, const void *b)
{
const git_diff_delta *da = a, *db = b;
diff --git a/src/idxmap.c b/src/idxmap.c
index 4dcf963..bc23608 100644
--- a/src/idxmap.c
+++ b/src/idxmap.c
@@ -138,28 +138,6 @@ void *git_idxmap_icase_get(git_idxmap_icase *map, const git_index_entry *key)
return kh_val(map, idx);
}
-void git_idxmap_insert(git_idxmap *map, const git_index_entry *key, void *value, int *rval)
-{
- khiter_t idx = kh_put(idx, map, key, rval);
-
- if ((*rval) >= 0) {
- if ((*rval) == 0)
- kh_key(map, idx) = key;
- kh_val(map, idx) = value;
- }
-}
-
-void git_idxmap_icase_insert(git_idxmap_icase *map, const git_index_entry *key, void *value, int *rval)
-{
- khiter_t idx = kh_put(idxicase, map, key, rval);
-
- if ((*rval) >= 0) {
- if ((*rval) == 0)
- kh_key(map, idx) = key;
- kh_val(map, idx) = value;
- }
-}
-
int git_idxmap_delete(git_idxmap *map, const git_index_entry *key)
{
khiter_t idx = kh_get(idx, map, key);
diff --git a/src/reflog.c b/src/reflog.c
index 24dada0..33b7310 100644
--- a/src/reflog.c
+++ b/src/reflog.c
@@ -14,11 +14,6 @@
#include <git2/sys/refdb_backend.h>
-git_reflog_entry *git_reflog_entry__alloc(void)
-{
- return git__calloc(1, sizeof(git_reflog_entry));
-}
-
void git_reflog_entry__free(git_reflog_entry *entry)
{
git_signature_free(entry->committer);