author | Lars Hjemli <hjemli@gmail.com> | 2008-02-16 20:16:53 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-02-16 20:48:19 (UTC) |
commit | b88fb016d0209f7041ac7d3b4d2c077318407a4d (patch) (side-by-side diff) | |
tree | 777e9cd042c3da9caaefe1f63363a52b56601521 /ui-shared.c | |
parent | d1f3bbe9d22029f45a77bb938c176ccc0c827d46 (diff) | |
download | cgit-b88fb016d0209f7041ac7d3b4d2c077318407a4d.zip cgit-b88fb016d0209f7041ac7d3b4d2c077318407a4d.tar.gz cgit-b88fb016d0209f7041ac7d3b4d2c077318407a4d.tar.bz2 |
Improve initialization of git directory
Using the functions offered by libgit feels like the right thing to do. Also,
make sure that config errors gets properly reported.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | ui-shared.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ui-shared.c b/ui-shared.c index b9f487a..cc1ab8b 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -447,65 +447,65 @@ void add_hidden_formfields(int incl_head, int incl_search, char *page) } if (incl_head && strcmp(ctx.qry.head, ctx.repo->defbranch)) html_hidden("h", ctx.qry.head); if (ctx.qry.sha1) html_hidden("id", ctx.qry.sha1); if (ctx.qry.sha2) html_hidden("id2", ctx.qry.sha2); if (incl_search) { if (ctx.qry.grep) html_hidden("qt", ctx.qry.grep); if (ctx.qry.search) html_hidden("q", ctx.qry.search); } } void cgit_print_pageheader(char *title, int show_search) { static const char *default_info = "This is cgit, a fast webinterface for git repositories"; int header = 0; char *url; html("<table id='layout' summary=''>\n"); html("<tr><td id='sidebar'>\n"); html("<table class='sidebar' cellspacing='0' summary=''>\n"); html("<tr><td class='sidebar'>\n<a href='"); html_attr(cgit_rooturl()); htmlf("'><img src='%s' alt='cgit'/></a>\n", ctx.cfg.logo); html("</td></tr>\n<tr><td class='sidebar'>\n"); - if (ctx.qry.repo) { + if (ctx.repo) { html("<h1 class='first'>"); html_txt(strrpart(ctx.repo->name, 20)); html("</h1>\n"); html_txt(ctx.repo->desc); if (ctx.repo->owner) { html("<h1>owner</h1>\n"); html_txt(ctx.repo->owner); } html("<h1>navigate</h1>\n"); reporevlink(NULL, "summary", NULL, "menu", ctx.qry.head, NULL, NULL); cgit_log_link("log", NULL, "menu", ctx.qry.head, NULL, NULL, 0, NULL, NULL); cgit_tree_link("tree", NULL, "menu", ctx.qry.head, ctx.qry.sha1, NULL); cgit_commit_link("commit", NULL, "menu", ctx.qry.head, ctx.qry.sha1); cgit_diff_link("diff", NULL, "menu", ctx.qry.head, ctx.qry.sha1, ctx.qry.sha2, NULL); cgit_patch_link("patch", NULL, "menu", ctx.qry.head, ctx.qry.sha1); for_each_ref(print_archive_ref, &header); if (ctx.repo->clone_url || ctx.cfg.clone_prefix) { html("<h1>clone</h1>\n"); if (ctx.repo->clone_url) url = ctx.repo->clone_url; else url = fmt("%s%s", ctx.cfg.clone_prefix, ctx.repo->url); html("<a class='menu' href='"); |