summaryrefslogtreecommitdiff
path: root/hash.h
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2021-04-26 01:02:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-27 07:31:38 (GMT)
commitcf0983213c72727c4c7dea51ed9b3b38a2968fbe (patch)
treeb807a7c3cc34cbc06b9669de470220229ebd48a1 /hash.h
parent89b43f80a514aee58b662ad606e6352e03eaeee4 (diff)
downloadgit-cf0983213c72727c4c7dea51ed9b3b38a2968fbe.zip
git-cf0983213c72727c4c7dea51ed9b3b38a2968fbe.tar.gz
git-cf0983213c72727c4c7dea51ed9b3b38a2968fbe.tar.bz2
hash: add an algo member to struct object_id
Now that we're working with multiple hash algorithms in the same repo, it's best if we label each object ID with its algorithm so we can determine how to format a given object ID. Add a member called algo to struct object_id. Performance testing on object ID-heavy workloads doesn't reveal a clear change in performance. Out of performance tests t0001 and t1450, there are slight variations in performance both up and down, but all measurements are within the margin of error. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'hash.h')
-rw-r--r--hash.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/hash.h b/hash.h
index 3fb0c3d..dafdcb3 100644
--- a/hash.h
+++ b/hash.h
@@ -181,6 +181,7 @@ static inline int hash_algo_by_ptr(const struct git_hash_algo *p)
struct object_id {
unsigned char hash[GIT_MAX_RAWSZ];
+ int algo;
};
#define the_hash_algo the_repository->hash_algo