about summary refs log tree commit diff
path: root/cgit.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-02-13 12:07:49 -0500
committerJune McEnroe <june@causal.agency>2022-02-13 12:10:49 -0500
commit516175469a8c6895496ef909b487992deb45f460 (patch)
treee0e8b4d38f05e870089de8babc0d3aca3bb4d3b0 /cgit.c
parentFix crash trying to print "this commit" on 404s (diff)
parentgit: update to v2.32.0 (diff)
downloadcgit-pink-516175469a8c6895496ef909b487992deb45f460.tar.gz
cgit-pink-516175469a8c6895496ef909b487992deb45f460.zip
Merge up to git v2.32.0
Diffstat (limited to 'cgit.c')
-rw-r--r--cgit.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/cgit.c b/cgit.c
index d8ea221..40825cb 100644
--- a/cgit.c
+++ b/cgit.c
@@ -324,11 +324,11 @@ static void querystring_cb(const char *name, const char *value)
 		ctx.qry.head = xstrdup(value);
 		ctx.qry.has_symref = 1;
 	} else if (!strcmp(name, "id")) {
-		ctx.qry.sha1 = xstrdup(value);
-		ctx.qry.has_sha1 = 1;
+		ctx.qry.oid = xstrdup(value);
+		ctx.qry.has_oid = 1;
 	} else if (!strcmp(name, "id2")) {
-		ctx.qry.sha2 = xstrdup(value);
-		ctx.qry.has_sha1 = 1;
+		ctx.qry.oid2 = xstrdup(value);
+		ctx.qry.has_oid = 1;
 	} else if (!strcmp(name, "ofs")) {
 		ctx.qry.ofs = atoi(value);
 	} else if (!strcmp(name, "path")) {
@@ -992,9 +992,9 @@ static void cgit_parse_args(int argc, const char **argv)
 		} else if (skip_prefix(argv[i], "--head=", &arg)) {
 			ctx.qry.head = xstrdup(arg);
 			ctx.qry.has_symref = 1;
-		} else if (skip_prefix(argv[i], "--sha1=", &arg)) {
-			ctx.qry.sha1 = xstrdup(arg);
-			ctx.qry.has_sha1 = 1;
+		} else if (skip_prefix(argv[i], "--oid=", &arg)) {
+			ctx.qry.oid = xstrdup(arg);
+			ctx.qry.has_oid = 1;
 		} else if (skip_prefix(argv[i], "--ofs=", &arg)) {
 			ctx.qry.ofs = atoi(arg);
 		} else if (skip_prefix(argv[i], "--scan-tree=", &arg) ||
@@ -1037,7 +1037,7 @@ static int calc_ttl(void)
 	if (!strcmp(ctx.qry.page, "snapshot"))
 		return ctx.cfg.cache_snapshot_ttl;
 
-	if (ctx.qry.has_sha1)
+	if (ctx.qry.has_oid)
 		return ctx.cfg.cache_static_ttl;
 
 	if (ctx.qry.has_symref)