2
0
mirror of https://git.zx2c4.com/cgit synced 2025-08-31 14:25:15 +00:00

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>
This commit is contained in:
Lars Hjemli
2008-10-11 20:09:42 +02:00
parent 5632ba35d1
commit ed7ff095ca
3 changed files with 83 additions and 15 deletions

2
cmd.c
View File

@@ -106,7 +106,7 @@ 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)