commit - f4425f95a55d6c26f06ecef7b3b8aa6a4a4247de
commit + 0a2fc48663670b6fb1a778aafc653227c9103442
blob - aba5a591662378d9b7363a6435d153408a11fb87
blob + b0b81d728aae26ca8ade03729c3738e50a573ac3
--- gotwebd/got_operations.c
+++ gotwebd/got_operations.c
}
const struct got_error *
-got_get_repo_commits(struct request *c, int limit)
+got_get_repo_commits(struct request *c, size_t limit)
{
const struct got_error *error = NULL;
struct got_object_id *id = NULL;
char *in_repo_path = NULL, *repo_path = NULL, *file_path = NULL;
int chk_next = 0;
- if (limit != 1 || srv->max_commits_display == 1) {
+ if (limit == 0)
+ return got_error(GOT_ERR_RANGE);
+
+ if (limit > 1) {
/*
* Traverse one commit more than requested to provide
* the next button.
blob - fae082679ec712db36cb01d56e5edb5857535ab7
blob + 057b25c7ef680bcd1c7f35556e2adaa42ed3da38
--- gotwebd/gotwebd.h
+++ gotwebd/gotwebd.h
const struct got_error *got_get_repo_owner(char **, struct request *);
const struct got_error *got_get_repo_age(time_t *, struct request *,
const char *);
-const struct got_error *got_get_repo_commits(struct request *, int);
+const struct got_error *got_get_repo_commits(struct request *, size_t);
const struct got_error *got_get_repo_tags(struct request *, int);
const struct got_error *got_get_repo_heads(struct request *);
const struct got_error *got_open_diff_for_output(FILE **, struct request *);