]> git.cameronkatri.com Git - cgit.git/blobdiff - cgit.c
git: update to v2.10.0
[cgit.git] / cgit.c
diff --git a/cgit.c b/cgit.c
index fc482bee0c83d34a38159d94fe0fa8bc6a4e42f1..2f29aa6d33082cd105d34f2bc195db493e3c90d3 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -616,11 +616,11 @@ static int prepare_repo_cmd(void)
        }
 
        if (get_sha1(ctx.qry.head, sha1)) {
-               char *tmp = xstrdup(ctx.qry.head);
-               ctx.qry.head = ctx.repo->defbranch;
+               char *old_head = ctx.qry.head;
+               ctx.qry.head = xstrdup(ctx.repo->defbranch);
                cgit_print_error_page(404, "Not found",
-                               "Invalid branch: %s", tmp);
-               free(tmp);
+                               "Invalid branch: %s", old_head);
+               free(old_head);
                return 1;
        }
        string_list_sort(&ctx.repo->submodules);
@@ -941,7 +941,7 @@ static void cgit_parse_args(int argc, const char **argv)
 
        for (i = 1; i < argc; i++) {
                if (!strcmp(argv[i], "--version")) {
-                       printf("CGit %s | http://git.zx2c4.com/cgit/\n\nCompiled in features:\n", CGIT_VERSION);
+                       printf("CGit %s | https://git.zx2c4.com/cgit/\n\nCompiled in features:\n", CGIT_VERSION);
 #ifdef NO_LUA
                        printf("[-] ");
 #else
@@ -1026,7 +1026,7 @@ static int calc_ttl(void)
        return ctx.cfg.cache_repo_ttl;
 }
 
-int main(int argc, const char **argv)
+int cmd_main(int argc, const char **argv)
 {
        const char *path;
        int err, ttl;