Unidiff1 files changed, 9 insertions, 0 deletions
|
diff --git a/cmd.c b/cmd.c index e0eacbe..6cc91e6 100644 --- a/ cmd.c+++ b/ cmd.c |
|
@@ -17,12 +17,20 @@ |
17 | #include "ui-repolist.h" |
17 | #include "ui-repolist.h" |
18 | #include "ui-snapshot.h" |
18 | #include "ui-snapshot.h" |
19 | #include "ui-summary.h" |
19 | #include "ui-summary.h" |
20 | #include "ui-tag.h" |
20 | #include "ui-tag.h" |
21 | #include "ui-tree.h" |
21 | #include "ui-tree.h" |
22 | |
22 | |
| |
23 | static void about_fn(struct cgit_context *ctx) |
| |
24 | { |
| |
25 | if (ctx->repo) |
| |
26 | cgit_print_repo_readme(); |
| |
27 | else |
| |
28 | cgit_print_site_readme(); |
| |
29 | } |
| |
30 | |
23 | static void blob_fn(struct cgit_context *ctx) |
31 | static void blob_fn(struct cgit_context *ctx) |
24 | { |
32 | { |
25 | cgit_print_blob(ctx->qry.sha1, ctx->qry.path); |
33 | cgit_print_blob(ctx->qry.sha1, ctx->qry.path); |
26 | } |
34 | } |
27 | |
35 | |
28 | static void commit_fn(struct cgit_context *ctx) |
36 | static void commit_fn(struct cgit_context *ctx) |
@@ -81,12 +89,13 @@ static void tree_fn(struct cgit_context *ctx) |
81 | #define def_cmd(name, want_repo, want_layout) \ |
89 | #define def_cmd(name, want_repo, want_layout) \ |
82 | {#name, name##_fn, want_repo, want_layout} |
90 | {#name, name##_fn, want_repo, want_layout} |
83 | |
91 | |
84 | struct cgit_cmd *cgit_get_cmd(struct cgit_context *ctx) |
92 | struct cgit_cmd *cgit_get_cmd(struct cgit_context *ctx) |
85 | { |
93 | { |
86 | static struct cgit_cmd cmds[] = { |
94 | static struct cgit_cmd cmds[] = { |
| |
95 | def_cmd(about, 0, 1), |
87 | def_cmd(blob, 1, 0), |
96 | def_cmd(blob, 1, 0), |
88 | def_cmd(commit, 1, 1), |
97 | def_cmd(commit, 1, 1), |
89 | def_cmd(diff, 1, 1), |
98 | def_cmd(diff, 1, 1), |
90 | def_cmd(log, 1, 1), |
99 | def_cmd(log, 1, 1), |
91 | def_cmd(patch, 1, 0), |
100 | def_cmd(patch, 1, 0), |
92 | def_cmd(refs, 1, 1), |
101 | def_cmd(refs, 1, 1), |
|