THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

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>
tags/v2.22.0-rc0
brian m. carlson Junio C Hamano 8 months ago
parent
commit
2235030755
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      notes-merge.c

+ 3
- 3
notes-merge.c View File

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

Loading…
Cancel
Save