Skip to content

Commit 20df814

Browse files
KarthikNayakgitster
authored andcommitted
midx-write: use revs->repo inside read_refs_snapshot
The function `read_refs_snapshot()` uses `parse_oid_hex()`, which relies on the global `the_hash_algo` variable. 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 function's definition. Signed-off-by: Karthik Nayak <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3687a4b commit 20df814

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

midx-write.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ static int read_refs_snapshot(const char *refs_snapshot,
760760
hex = &buf.buf[1];
761761
}
762762

763-
if (parse_oid_hex(hex, &oid, &end) < 0)
763+
if (parse_oid_hex_algop(hex, &oid, &end, revs->repo->hash_algo) < 0)
764764
die(_("could not parse line: %s"), buf.buf);
765765
if (*end)
766766
die(_("malformed line: %s"), buf.buf);
@@ -776,6 +776,7 @@ static int read_refs_snapshot(const char *refs_snapshot,
776776
strbuf_release(&buf);
777777
return 0;
778778
}
779+
779780
static struct commit **find_commits_for_midx_bitmap(uint32_t *indexed_commits_nr_p,
780781
const char *refs_snapshot,
781782
struct write_midx_context *ctx)

0 commit comments

Comments
 (0)