aboutsummaryrefslogtreecommitdiff
path: root/ui-snapshot.c
diff options
context:
space:
mode:
authorLinnea Gräf <nea@nea.moe>2024-09-19 15:23:28 +0200
committerLinnea Gräf <nea@nea.moe>2024-09-19 15:28:18 +0200
commit0f11492868791513cbaae69c6476a00647f3fd47 (patch)
treebb1328076fd7d1091c1b63563cf76c8f7b936527 /ui-snapshot.c
parent09d24d7cd0b7e85633f2f43808b12871bb209d69 (diff)
downloadcgit-0f11492868791513cbaae69c6476a00647f3fd47.tar.gz
cgit-0f11492868791513cbaae69c6476a00647f3fd47.tar.bz2
cgit-0f11492868791513cbaae69c6476a00647f3fd47.zip
ui-snapshot: add option to disable prefixHEADmaster
Hi everyone, it is me, ui snapshot prefix remover 3000 here today coming at you with another git patch
Diffstat (limited to 'ui-snapshot.c')
-rw-r--r--ui-snapshot.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/ui-snapshot.c b/ui-snapshot.c
index 3e38cd5..acae68c 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -308,11 +308,17 @@ void cgit_print_snapshot(const char *head, const char *hex,
if (!prefix)
prefix = xstrdup(cgit_snapshot_prefix(ctx.repo));
+ if (!ctx.cfg.enable_snapshot_prefix && !ctx.repo->snapshot_prefix) {
+ free(prefix);
+ prefix = NULL;
+ }
+
if (sig_filename)
write_sig(f, hex, filename, sig_filename);
else
make_snapshot(f, hex, prefix, filename);
- free(prefix);
+ if (prefix)
+ free(prefix);
free(adj_filename);
}