Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-02-19 03:05:07 +0300
committerJunio C Hamano <gitster@pobox.com>2019-04-01 05:57:38 +0300
commit24dd363ed586f5edbdea96689d4e0e40a7d3f7fa (patch)
tree9cd737e581e3ab8cb235a9f71f85fb186f2c5342 /builtin
parentef479a12bd9e2891c7a1262d95f7d540f79e4a81 (diff)
builtin/am: make hash size independent
Instead of using GIT_SHA1_HEXSZ, switch to using the_hash_algo and parse_oid_hex to parse the lines involved in rebasing notes. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/am.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/am.c b/builtin/am.c
index 4fb107a9d1..5556a0651e 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -486,23 +486,24 @@ static int copy_notes_for_rebase(const struct am_state *state)
while (!strbuf_getline_lf(&sb, fp)) {
struct object_id from_obj, to_obj;
+ const char *p;
- if (sb.len != GIT_SHA1_HEXSZ * 2 + 1) {
+ if (sb.len != the_hash_algo->hexsz * 2 + 1) {
ret = error(invalid_line, sb.buf);
goto finish;
}
- if (get_oid_hex(sb.buf, &from_obj)) {
+ if (parse_oid_hex(sb.buf, &from_obj, &p)) {
ret = error(invalid_line, sb.buf);
goto finish;
}
- if (sb.buf[GIT_SHA1_HEXSZ] != ' ') {
+ if (*p != ' ') {
ret = error(invalid_line, sb.buf);
goto finish;
}
- if (get_oid_hex(sb.buf + GIT_SHA1_HEXSZ + 1, &to_obj)) {
+ if (get_oid_hex(p + 1, &to_obj)) {
ret = error(invalid_line, sb.buf);
goto finish;
}