author | Lars Hjemli <hjemli@gmail.com> | 2008-10-11 18:09:42 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-10-11 18:09:42 (UTC) |
commit | ed7ff095ca467cdc4c8a1a1459847d68e50c9b91 (patch) (side-by-side diff) | |
tree | 4ed7425520cb76eff0a4e7756869620b2562b6c9 /cmd.c | |
parent | 5632ba35d133ee29d46c031cdd4b4a37097b8ca1 (diff) | |
download | cgit-ed7ff095ca467cdc4c8a1a1459847d68e50c9b91.zip cgit-ed7ff095ca467cdc4c8a1a1459847d68e50c9b91.tar.gz cgit-ed7ff095ca467cdc4c8a1a1459847d68e50c9b91.tar.bz2 |
ui-snapshot: add dwimmery
When downloading a snapshot, the snapshot name will often contain the repo
name combined with a tag. This patch tries to exploit this so that the
correct revision is downloaded even if no specific revision is specified.
PS: this only occurs if neither 'h' nor 'id' is specified in the query-
string.
PPS: this also fixes a bug which occurs when trying to download a filename
with an unsupported suffix: it used to try to print an error message to
the user but failed since it didn't prepare the output properly.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -85,49 +85,49 @@ static void objects_fn(struct cgit_context *ctx) static void repolist_fn(struct cgit_context *ctx) { cgit_print_repolist(); } static void patch_fn(struct cgit_context *ctx) { cgit_print_patch(ctx->qry.sha1); } static void plain_fn(struct cgit_context *ctx) { cgit_print_plain(ctx); } static void refs_fn(struct cgit_context *ctx) { cgit_print_refs(); } static void snapshot_fn(struct cgit_context *ctx) { cgit_print_snapshot(ctx->qry.head, ctx->qry.sha1, cgit_repobasename(ctx->repo->url), ctx->qry.path, - ctx->repo->snapshots); + ctx->repo->snapshots, ctx->qry.nohead); } static void summary_fn(struct cgit_context *ctx) { cgit_print_summary(); } static void tag_fn(struct cgit_context *ctx) { cgit_print_tag(ctx->qry.sha1); } static void tree_fn(struct cgit_context *ctx) { cgit_print_tree(ctx->qry.sha1, ctx->qry.path); } #define def_cmd(name, want_repo, want_layout) \ {#name, name##_fn, want_repo, want_layout} struct cgit_cmd *cgit_get_cmd(struct cgit_context *ctx) { static struct cgit_cmd cmds[] = { def_cmd(HEAD, 1, 0), |