This commit is contained in:
@@ -221,6 +221,23 @@ export function listGiteaCommits(
|
||||
).then((result) => result.commits);
|
||||
}
|
||||
|
||||
export function listGiteaCommitsPage(
|
||||
owner: string,
|
||||
repo: string,
|
||||
branch = 'develop',
|
||||
options: { page: number; limit: number; since?: string }
|
||||
) {
|
||||
const params = new URLSearchParams({
|
||||
sha: branch,
|
||||
page: String(options.page),
|
||||
limit: String(options.limit)
|
||||
});
|
||||
if (options.since) params.set('since', options.since);
|
||||
return apiRequest<{ commits: GiteaCommit[]; total: number | null; page: number; limit: number }>(
|
||||
`/gitea/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/commits?${params.toString()}`
|
||||
);
|
||||
}
|
||||
|
||||
export function getGiteaCommitDiff(owner: string, repo: string, sha: string) {
|
||||
return apiRequest<{ diff: string }>(
|
||||
`/gitea/repos/${encodeURIComponent(owner)}/${encodeURIComponent(repo)}/commits/${encodeURIComponent(sha)}/diff`
|
||||
|
||||
Reference in New Issue
Block a user