summaryrefslogtreecommitdiff
path: root/notes-merge.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-02-19 00:05:00 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-04-01 02:57:37 (GMT)
commit22350307550c8503ef1738f911cabba63c3a4901 (patch)
treec359180b12f88a09e435f3d5e112b506667f3906 /notes-merge.c
parentdb1ba2a2302e7942981c70f9356c70e21e3f7bc7 (diff)
downloadgit-22350307550c8503ef1738f911cabba63c3a4901.zip
git-22350307550c8503ef1738f911cabba63c3a4901.tar.gz
git-22350307550c8503ef1738f911cabba63c3a4901.tar.bz2
notes-merge: switch to use the_hash_algo
Switch from using GIT_SHA1_HEXSZ to GIT_MAX_HEXSZ and the_hash_algo so that the code works with any hash algorithm. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'notes-merge.c')
-rw-r--r--notes-merge.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/notes-merge.c b/notes-merge.c
index 280aa8e..2fe724f 100644
--- a/notes-merge.c
+++ b/notes-merge.c
@@ -29,14 +29,14 @@ void init_notes_merge_options(struct repository *r,
static int path_to_oid(const char *path, struct object_id *oid)
{
- char hex_oid[GIT_SHA1_HEXSZ];
+ char hex_oid[GIT_MAX_HEXSZ];
int i = 0;
- while (*path && i < GIT_SHA1_HEXSZ) {
+ while (*path && i < the_hash_algo->hexsz) {
if (*path != '/')
hex_oid[i++] = *path;
path++;
}
- if (*path || i != GIT_SHA1_HEXSZ)
+ if (*path || i != the_hash_algo->hexsz)
return -1;
return get_oid_hex(hex_oid, oid);
}