author | Michael Krelin <hacker@klever.net> | 2008-06-24 21:33:24 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2008-06-24 21:33:24 (UTC) |
commit | 01d2dce7e73e3f022d186de27dd5d15574144ca8 (patch) (unidiff) | |
tree | eeb2cc9089b048ddb6ee7c2f2c1ca5738b6e6a51 /cmd.c | |
parent | e6b635c2b1a0b2c08170c70e8b9e59f4b9789431 (diff) | |
download | cgit-01d2dce7e73e3f022d186de27dd5d15574144ca8.zip cgit-01d2dce7e73e3f022d186de27dd5d15574144ca8.tar.gz cgit-01d2dce7e73e3f022d186de27dd5d15574144ca8.tar.bz2 |
allow blob extract blobs by head/path combination
If blob is invoked with no id=, it tries to look up h= and search for path= in
there. Once found, proceed as normal, otherwise, fail as normal.
Signed-off-by: Michael Krelin <hacker@klever.net>
-rw-r--r-- | cmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -11,49 +11,49 @@ | |||
11 | #include "cache.h" | 11 | #include "cache.h" |
12 | #include "ui-shared.h" | 12 | #include "ui-shared.h" |
13 | #include "ui-blob.h" | 13 | #include "ui-blob.h" |
14 | #include "ui-commit.h" | 14 | #include "ui-commit.h" |
15 | #include "ui-diff.h" | 15 | #include "ui-diff.h" |
16 | #include "ui-log.h" | 16 | #include "ui-log.h" |
17 | #include "ui-patch.h" | 17 | #include "ui-patch.h" |
18 | #include "ui-refs.h" | 18 | #include "ui-refs.h" |
19 | #include "ui-repolist.h" | 19 | #include "ui-repolist.h" |
20 | #include "ui-snapshot.h" | 20 | #include "ui-snapshot.h" |
21 | #include "ui-summary.h" | 21 | #include "ui-summary.h" |
22 | #include "ui-tag.h" | 22 | #include "ui-tag.h" |
23 | #include "ui-tree.h" | 23 | #include "ui-tree.h" |
24 | 24 | ||
25 | static void about_fn(struct cgit_context *ctx) | 25 | static void about_fn(struct cgit_context *ctx) |
26 | { | 26 | { |
27 | if (ctx->repo) | 27 | if (ctx->repo) |
28 | cgit_print_repo_readme(); | 28 | cgit_print_repo_readme(); |
29 | else | 29 | else |
30 | cgit_print_site_readme(); | 30 | cgit_print_site_readme(); |
31 | } | 31 | } |
32 | 32 | ||
33 | static void blob_fn(struct cgit_context *ctx) | 33 | static void blob_fn(struct cgit_context *ctx) |
34 | { | 34 | { |
35 | cgit_print_blob(ctx->qry.sha1, ctx->qry.path); | 35 | cgit_print_blob(ctx->qry.sha1, ctx->qry.path, ctx->qry.head); |
36 | } | 36 | } |
37 | 37 | ||
38 | static void commit_fn(struct cgit_context *ctx) | 38 | static void commit_fn(struct cgit_context *ctx) |
39 | { | 39 | { |
40 | cgit_print_commit(ctx->qry.sha1); | 40 | cgit_print_commit(ctx->qry.sha1); |
41 | } | 41 | } |
42 | 42 | ||
43 | static void diff_fn(struct cgit_context *ctx) | 43 | static void diff_fn(struct cgit_context *ctx) |
44 | { | 44 | { |
45 | cgit_print_diff(ctx->qry.sha1, ctx->qry.sha2, ctx->qry.path); | 45 | cgit_print_diff(ctx->qry.sha1, ctx->qry.sha2, ctx->qry.path); |
46 | } | 46 | } |
47 | 47 | ||
48 | static void log_fn(struct cgit_context *ctx) | 48 | static void log_fn(struct cgit_context *ctx) |
49 | { | 49 | { |
50 | cgit_print_log(ctx->qry.sha1, ctx->qry.ofs, ctx->cfg.max_commit_count, | 50 | cgit_print_log(ctx->qry.sha1, ctx->qry.ofs, ctx->cfg.max_commit_count, |
51 | ctx->qry.grep, ctx->qry.search, ctx->qry.path, 1); | 51 | ctx->qry.grep, ctx->qry.search, ctx->qry.path, 1); |
52 | } | 52 | } |
53 | 53 | ||
54 | static void ls_cache_fn(struct cgit_context *ctx) | 54 | static void ls_cache_fn(struct cgit_context *ctx) |
55 | { | 55 | { |
56 | ctx->page.mimetype = "text/plain"; | 56 | ctx->page.mimetype = "text/plain"; |
57 | ctx->page.filename = "ls-cache.txt"; | 57 | ctx->page.filename = "ls-cache.txt"; |
58 | cgit_print_http_headers(ctx); | 58 | cgit_print_http_headers(ctx); |
59 | cache_ls(ctx->cfg.cache_root); | 59 | cache_ls(ctx->cfg.cache_root); |