summary refs log tree commit diff
path: root/parsing.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-06-08 14:27:44 -0400
committerJune McEnroe <june@causal.agency>2021-06-08 14:27:44 -0400
commit5213546273ee798369ff594ad60077f1bef4655e (patch)
tree37e7aec5ddc583047da1126ffdc41a81f20cf1f6 /parsing.c
parentSquashed 'www/git.causal.agency/cgit/' content from commit 02221fd3 (diff)
downloadsrc-5213546273ee798369ff594ad60077f1bef4655e.tar.gz
src-5213546273ee798369ff594ad60077f1bef4655e.zip
Squashed 'www/git.causal.agency/cgit/' changes from 55fa25ad..5258c297
5258c297 git: update to v2.32.0
6dbbffe0 git: update to v2.31.1
62eb8db4 md2html: use proper formatting for hr
d889cae8 git: update to v2.31.0
4ffadc1e git: update to v2.30.1
bd6f5683 tests: t0107: support older and/or non-GNU tar
f69626c6 md2html: use sane_lists extension
cef27b67 git: update to v2.30.0
b1739247 git: update to v2.29.2
fe99c76e git: update to v2.29.1
adcc4f82 tests: try with commit-graph
a1039ab1 tests: do not copy snapshots to /tmp/
a4de0e81 global: replace hard coded hash length
779631c6 global: replace references to 'sha1' with 'oid'
629659d2 git: update to v2.29.0
205837d4 git: update to v2.28.0
f780396c git: update to v2.27.0
0462f08d git: update to v2.26.0

git-subtree-dir: www/git.causal.agency/cgit
git-subtree-split: 5258c297ba6fb604ae1415fbc19a3fe42457e49e
Diffstat (limited to 'parsing.c')
-rw-r--r--parsing.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/parsing.c b/parsing.c
index 93b4767e..72b59b3c 100644
--- a/parsing.c
+++ b/parsing.c
@@ -127,7 +127,6 @@ static int end_of_header(const char *p)
 
 struct commitinfo *cgit_parse_commit(struct commit *commit)
 {
-	const int sha1hex_len = 40;
 	struct commitinfo *ret;
 	const char *p = repo_get_commit_buffer(the_repository, commit, NULL);
 	const char *t;
@@ -140,10 +139,10 @@ struct commitinfo *cgit_parse_commit(struct commit *commit)
 
 	if (!skip_prefix(p, "tree ", &p))
 		die("Bad commit: %s", oid_to_hex(&commit->object.oid));
-	p += sha1hex_len + 1;
+	p += the_hash_algo->hexsz + 1;
 
 	while (skip_prefix(p, "parent ", &p))
-		p += sha1hex_len + 1;
+		p += the_hash_algo->hexsz + 1;
 
 	if (p && skip_prefix(p, "author ", &p)) {
 		parse_user(p, &ret->author, &ret->author_email,