Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Spell the signature suffix once for both files
Diffstat (limited to 'source')
-rw-r--r--source/ui-shared.c4
-rw-r--r--source/ui-snapshot.c2
-rw-r--r--source/ui-snapshot.h3
3 files changed, 5 insertions, 4 deletions
diff --git a/source/ui-shared.c b/source/ui-shared.c
index 1d09c26..5f5dcca 100644
--- a/source/ui-shared.c
+++ b/source/ui-shared.c
@@ -1808,7 +1808,7 @@ void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *ref, co
html("<span class='snapshot'>");
snapshot_link(filename.buf, NULL, NULL, NULL, NULL, filename.buf);
if (cgit_snapshot_get_sig(ref, f)) {
- strbuf_addstr(&filename, ".asc");
+ strbuf_addstr(&filename, SIG_SUFFIX);
html(" (");
snapshot_link("sig", NULL, NULL, NULL, NULL, filename.buf);
html(")");
@@ -1820,7 +1820,7 @@ void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *ref, co
// the plain tar it expands to, which is the first
// format in the table.
strbuf_setlen(&filename, filename.len - strlen(f->suffix));
- strbuf_addstr(&filename, ".tar.asc");
+ strbuf_addstr(&filename, ".tar" SIG_SUFFIX);
html(" (");
snapshot_link("sig", NULL, NULL, NULL, NULL, filename.buf);
html(")");
diff --git a/source/ui-snapshot.c b/source/ui-snapshot.c
index 04defa6..2fa121f 100644
--- a/source/ui-snapshot.c
+++ b/source/ui-snapshot.c
@@ -19,8 +19,6 @@
#include "ui-shared.h"
#include "ui-snapshot.h"
-#define SIG_SUFFIX ".asc"
-
static void write_archive_format(const char *format_arg, const char *hex, const char *prefix)
{
struct strvec argv = STRVEC_INIT;
diff --git a/source/ui-snapshot.h b/source/ui-snapshot.h
index 2278f4c..77252b5 100644
--- a/source/ui-snapshot.h
+++ b/source/ui-snapshot.h
@@ -33,6 +33,9 @@ extern unsigned cgit_snapshot_format_bit(const struct cgit_snapshot_format *f);
*/
extern int cgit_parse_snapshots_mask(const char *str);
+// The suffix that names a signature after the archive it signs.
+#define SIG_SUFFIX ".asc"
+
/*
* The detached signature stored for this format under refs/notes, if any.
*/