Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
notes-merge: switch to use the_hash_algo
author
brian m. carlson
<sandals@crustytoothpaste.net>
Tue, 19 Feb 2019 00:05:00 +0000
(
00:05
+0000)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 1 Apr 2019 02:57:37 +0000
(11:57 +0900)
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>
notes-merge.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
db1ba2a
)
diff --git
a/notes-merge.c
b/notes-merge.c
index 280aa8e6c1b04136d4718b970adca19a1a9eb9cf..2fe724f1cf8dc3cc333b9f2aa122452feac27c2c 100644
(file)
--- 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);
}