Commit 7c499b544dc3383cce38956f86d67f328bc718e6

Patrick Steinhardt 2020-06-08T12:39:09

tree-wide: remove unused functions We have some functions which aren't used anywhere. Let's remove them to get rid of unneeded baggage.

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);