@@ -760,7 +760,7 @@ static int read_refs_snapshot(const char *refs_snapshot,
hex = &buf.buf[1];
}
- if (parse_oid_hex(hex, &oid, &end) < 0)
+ if (parse_oid_hex_algop(hex, &oid, &end, revs->repo->hash_algo) < 0)
die(_("could not parse line: %s"), buf.buf);
if (*end)
die(_("malformed line: %s"), buf.buf);
@@ -776,6 +776,7 @@ static int read_refs_snapshot(const char *refs_snapshot,
strbuf_release(&buf);
return 0;
}
+
static struct commit **find_commits_for_midx_bitmap(uint32_t *indexed_commits_nr_p,
const char *refs_snapshot,
struct write_midx_context *ctx)
The `read_refs_snapshot` uses the `parse_oid_hex` function which internally uses global variables. Let's instead use `parse_oid_hex_algop` and provide the hash algo via `revs->repo`. Also, while here, fix a missing newline after the functions definition. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> --- midx-write.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)