mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 14:20:42 +08:00
+10
-3
@@ -1,4 +1,4 @@
|
||||
import type { Stats, Person } from "@app/project";
|
||||
import { Stats, Person, Project } from "@app/project";
|
||||
import type { Diff } from "@app/diff";
|
||||
import { ApiError } from "@app/api";
|
||||
|
||||
@@ -59,14 +59,14 @@ export interface CommitGroup {
|
||||
week: number;
|
||||
}
|
||||
|
||||
export interface CommitStats {
|
||||
export interface DiffStats {
|
||||
additions: number;
|
||||
deletions: number;
|
||||
}
|
||||
|
||||
export interface Commit {
|
||||
header: CommitHeader;
|
||||
stats: CommitStats;
|
||||
stats: DiffStats;
|
||||
diff: Diff;
|
||||
branches: string[];
|
||||
context: CommitContext;
|
||||
@@ -129,6 +129,13 @@ export function groupCommits(commits: { header: CommitHeader; context: CommitCon
|
||||
}
|
||||
}
|
||||
|
||||
export async function fetchCommits(project: Project, parentCommit: string): Promise<GroupedCommitsHistory> {
|
||||
const commitsQuery = await Project.getCommits(project.urn, project.seed.api, {
|
||||
parent: parentCommit, verified: true
|
||||
});
|
||||
return groupCommitHistory(commitsQuery);
|
||||
}
|
||||
|
||||
export function groupCommitsByWeek(commits: CommitMetadata[]): CommitGroup[] {
|
||||
const groupedCommits: CommitGroup[] = [];
|
||||
let groupDate: Date | undefined = undefined;
|
||||
|
||||
Reference in New Issue
Block a user