summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2024-11-27 17:28:27 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-04 02:32:20 +0100
commit20df8141f5b7c015abb1090b19e4d24439e500c0 (patch)
treee9a8ed9176412e7bf198703cf9b656229e4c4e6a
parentmidx-write: pass down repository to static functions (diff)
downloadgit-20df8141f5b7c015abb1090b19e4d24439e500c0.tar.xz
git-20df8141f5b7c015abb1090b19e4d24439e500c0.zip
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 <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--midx-write.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/midx-write.c b/midx-write.c
index 22b5233f51..564438f616 100644
--- a/midx-write.c
+++ b/midx-write.c
@@ -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)