about summary refs log tree commit diff stats
path: root/cgit.c
diff options
context:
space:
mode:
authorChristian Hesse2020-10-20 23:32:45 +0200
committerChristian Hesse2020-10-20 23:57:12 +0200
commit779631c6dc23c15bbbf45a7c7ab9fffb619037b7 (patch)
tree99ddcae06134e97ef490fb1a4c9f6ab095ca5052 /cgit.c
parentgit: update to v2.29.0 (diff)
downloadcgit-779631c6dc23c15bbbf45a7c7ab9fffb619037b7.tar.gz
cgit-779631c6dc23c15bbbf45a7c7ab9fffb619037b7.zip
global: replace references to 'sha1' with 'oid'
For some time now sha1 is considered broken and upstream is working to
replace it with sha256. Replace all references to 'sha1' with 'oid',
just as upstream does.

Signed-off-by: Christian Hesse <mail@eworm.de>
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 c4320f0..08d81a1 100644 --- a/cgit.c +++ b/cgit.c
@@ -324,11 +324,11 @@ static void querystring_cb(const char *name, const char *value)
324 ctx.qry.head = xstrdup(value); 324 ctx.qry.head = xstrdup(value);
325 ctx.qry.has_symref = 1; 325 ctx.qry.has_symref = 1;
326 } else if (!strcmp(name, "id")) { 326 } else if (!strcmp(name, "id")) {
327 ctx.qry.sha1 = xstrdup(value); 327 ctx.qry.oid = xstrdup(value);
328 ctx.qry.has_sha1 = 1; 328 ctx.qry.has_oid = 1;
329 } else if (!strcmp(name, "id2")) { 329 } else if (!strcmp(name, "id2")) {
330 ctx.qry.sha2 = xstrdup(value); 330 ctx.qry.oid2 = xstrdup(value);
331 ctx.qry.has_sha1 = 1; 331 ctx.qry.has_oid = 1;
332 } else if (!strcmp(name, "ofs")) { 332 } else if (!strcmp(name, "ofs")) {
333 ctx.qry.ofs = atoi(value); 333 ctx.qry.ofs = atoi(value);
334 } else if (!strcmp(name, "path")) { 334 } else if (!strcmp(name, "path")) {
@@ -992,9 +992,9 @@ static void cgit_parse_args(int argc, const char **argv)
992 } else if (skip_prefix(argv[i], "--head=", &arg)) { 992 } else if (skip_prefix(argv[i], "--head=", &arg)) {
993 ctx.qry.head = xstrdup(arg); 993 ctx.qry.head = xstrdup(arg);
994 ctx.qry.has_symref = 1; 994 ctx.qry.has_symref = 1;
995 } else if (skip_prefix(argv[i], "--sha1=", &arg)) { 995 } else if (skip_prefix(argv[i], "--oid=", &arg)) {
996 ctx.qry.sha1 = xstrdup(arg); 996 ctx.qry.oid = xstrdup(arg);
997 ctx.qry.has_sha1 = 1; 997 ctx.qry.has_oid = 1;
998 } else if (skip_prefix(argv[i], "--ofs=", &arg)) { 998 } else if (skip_prefix(argv[i], "--ofs=", &arg)) {
999 ctx.qry.ofs = atoi(arg); 999 ctx.qry.ofs = atoi(arg);
1000 } else if (skip_prefix(argv[i], "--scan-tree=", &arg) || 1000 } else if (skip_prefix(argv[i], "--scan-tree=", &arg) ||
@@ -1037,7 +1037,7 @@ static int calc_ttl(void)
1037 if (!strcmp(ctx.qry.page, "snapshot")) 1037 if (!strcmp(ctx.qry.page, "snapshot"))
1038 return ctx.cfg.cache_snapshot_ttl; 1038 return ctx.cfg.cache_snapshot_ttl;
1039 1039
1040 if (ctx.qry.has_sha1) 1040 if (ctx.qry.has_oid)
1041 return ctx.cfg.cache_static_ttl; 1041 return ctx.cfg.cache_static_ttl;
1042 1042
1043 if (ctx.qry.has_symref) 1043 if (ctx.qry.has_symref)