+ strbuf_splice(&snapshot, 0, 1, "V", 1);
+ if (get_sha1(snapshot.buf, sha1) == 0)
+ goto out;
+
+ result = 0;
+ strbuf_release(&snapshot);
+
+out:
+ return result ? strbuf_detach(&snapshot, NULL) : NULL;
+}
+
+__attribute__((format (printf, 1, 2)))
+static void show_error(char *fmt, ...)
+{
+ va_list ap;
+
+ ctx.page.mimetype = "text/html";
+ cgit_print_http_headers();
+ cgit_print_docstart();
+ cgit_print_pageheader();
+ va_start(ap, fmt);
+ cgit_vprint_error(fmt, ap);
+ va_end(ap);
+ cgit_print_docend();