aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui-snapshot.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ui-snapshot.c b/ui-snapshot.c
index 8e76977..42b7489 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -140,8 +140,8 @@ static int make_snapshot(const struct cgit_snapshot_format *format,
* repo_basename(), we strip the basename and any following '-' and '_'
* characters ("cgit-0.7.2" -> "0.7.2") and check the resulting name once
* more. If this still isn't a valid commit object name, we check if pre-
- * pending a 'v' to the remaining snapshot name ("0.7.2" -> "v0.7.2") gives
- * us something valid.
+ * pending a 'v' or a 'V' to the remaining snapshot name ("0.7.2" ->
+ * "v0.7.2") gives us something valid.
*/
static const char *get_ref_from_filename(const char *url, const char *filename,
const struct cgit_snapshot_format *format)
@@ -173,6 +173,10 @@ static const char *get_ref_from_filename(const char *url, const char *filename,
if (get_sha1(snapshot.buf, sha1) == 0)
goto out;
+ strbuf_splice(&snapshot, 0, 1, "V", 1);
+ if (get_sha1(snapshot.buf, sha1) == 0)
+ goto out;
+
result = 0;
strbuf_release(&snapshot);