about summary refs log tree commit diff
path: root/overlays
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-04-15 01:21:04 +0000
committerAlyssa Ross <hi@alyssa.is>2021-04-15 01:22:01 +0000
commit1982260c6767eb5f8fc64cea390eed797bbf6d65 (patch)
tree5d318ec82168115197c7f9e80fdc0441f141f444 /overlays
parent3fe5aa8691070eecaaa0a26a1236dd636f23e792 (diff)
downloadnixlib-1982260c6767eb5f8fc64cea390eed797bbf6d65.tar
nixlib-1982260c6767eb5f8fc64cea390eed797bbf6d65.tar.gz
nixlib-1982260c6767eb5f8fc64cea390eed797bbf6d65.tar.bz2
nixlib-1982260c6767eb5f8fc64cea390eed797bbf6d65.tar.lz
nixlib-1982260c6767eb5f8fc64cea390eed797bbf6d65.tar.xz
nixlib-1982260c6767eb5f8fc64cea390eed797bbf6d65.tar.zst
nixlib-1982260c6767eb5f8fc64cea390eed797bbf6d65.zip
patches/cgit: fix crash
Thanks-to: C. McEnroe <june@causal.agency>
Diffstat (limited to 'overlays')
-rw-r--r--overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch4
1 files changed, 3 insertions, 1 deletions
diff --git a/overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch b/overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch
index 79ea36e4b8ce..7578bd21a8a9 100644
--- a/overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch
+++ b/overlays/patches/cgit/ui-shared-add-this-commit-option-to-switch-form.patch
@@ -15,6 +15,8 @@ that.
 A "permalink" link on the blob view next to the "plain" link would
 probably be more discoverable, but that would only work for the blob
 view.  The switch UI is visible everywhere.
+
+Co-authored-by: C. McEnroe <june@causal.agency>
 ---
  ui-shared.c | 12 ++++++++++++
  1 file changed, 12 insertions(+)
@@ -30,7 +32,7 @@ index d2358f2..e1a3603 100644
 +static int print_this_commit_option(void)
 +{
 +	struct object_id oid;
-+	if (get_oid(ctx.qry.head, &oid))
++	if (!ctx.qry.head || get_oid(ctx.qry.head, &oid))
 +		return 1;
 +	html_option(oid_to_hex(&oid), "this commit", ctx.qry.head);
 +	return 0;