Workaround negative pages
This commit is contained in:
@@ -44,8 +44,12 @@ class GiteaService(private val handle: GiteaApiService) : RepositoryService {
|
|||||||
sha: String?,
|
sha: String?,
|
||||||
page: Int
|
page: Int
|
||||||
): List<CommitActivity> = withContext(Dispatchers.IO) {
|
): List<CommitActivity> = withContext(Dispatchers.IO) {
|
||||||
|
if (page < 1) {
|
||||||
|
emptyList()
|
||||||
|
} else {
|
||||||
handle.listCommits(repository.identifier.owner, repository.identifier.name, sha, page)
|
handle.listCommits(repository.identifier.owner, repository.identifier.name, sha, page)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
override suspend fun listFileContents(repository: RepositoryIdentifiable, filePath: String): List<VersionedFile> = withContext(Dispatchers.IO) {
|
override suspend fun listFileContents(repository: RepositoryIdentifiable, filePath: String): List<VersionedFile> = withContext(Dispatchers.IO) {
|
||||||
handle.listFileContents(repository.identifier.owner, repository.identifier.name, filePath)
|
handle.listFileContents(repository.identifier.owner, repository.identifier.name, filePath)
|
||||||
|
Reference in New Issue
Block a user