about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ui-shared.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/ui-shared.c b/ui-shared.c
index 07d5dd4..6cb7edb 100644
--- a/ui-shared.c
+++ b/ui-shared.c
@@ -760,13 +760,18 @@ void cgit_print_snapshot_links(const char *repo, const char *head,
 			       const char *hex, int snapshots)
 {
 	const struct cgit_snapshot_format* f;
+	char *prefix;
     	char *filename;
+	unsigned char sha1[20];
 
+	if (get_sha1(fmt("refs/tags/%s", hex), sha1) == 0 &&
+	    (hex[0] == 'v' || hex[0] == 'V') && isdigit(hex[1]))
+		hex++;
+	prefix = xstrdup(fmt("%s-%s", cgit_repobasename(repo), hex));
 	for (f = cgit_snapshot_formats; f->suffix; f++) {
 		if (!(snapshots & f->bit))
 			continue;
-		filename = fmt("%s-%s%s", cgit_repobasename(repo), hex,
-			       f->suffix);
+		filename = fmt("%s%s", prefix, f->suffix);
 		cgit_snapshot_link(filename, NULL, NULL, NULL, NULL, filename);
 		html("<br/>");
 	}
Keeping 2013-03-20Convert pager navigation into a unordered listLukas Fleischer 2013-03-20Makefile: remove CGIT-CFLAGS files in clean stageJason A. Donenfeld 2013-03-20ui-summary.c: Move urls variable into print_urls()Lukas Fleischer 2013-03-20Fix colspan valuesLukas Fleischer 2013-03-20html: check return value of writeJason A. Donenfeld 2013-03-20ui-shared: squelch compiler warning.Jason A. Donenfeld 2013-03-20cgit.mk: Use SHELL_PATH_SQ to run gen-version.shJohn Keeping 2013-03-20cgit.mk: don't rebuild everything if CGIT_VERSION changesJohn Keeping 2013-03-20ui-patch: use cgit_version not CGIT_VERSIONJohn Keeping 2013-03-20Makefile: re-use Git's Makefile where possibleJohn Keeping