added diff info and hover for commits
This commit is contained in:
@@ -7,6 +7,13 @@ export interface GitCommit {
|
||||
url: string;
|
||||
timestamp: Date;
|
||||
user: string;
|
||||
diff: Diff;
|
||||
}
|
||||
|
||||
export interface Diff {
|
||||
additions: number;
|
||||
deletions: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
const CACHE_TTL = 3 * 60 * 60 * 1000;
|
||||
@@ -68,12 +75,17 @@ async function fetchLatestCommits(
|
||||
let newCommit: GitCommit = {
|
||||
message: commit.commit.message,
|
||||
hash: commit.sha,
|
||||
shortHash: commit.sha.substring(0, 8),
|
||||
shortHash: commit.sha.substring(0, 6),
|
||||
timestamp: new Date(commit.created),
|
||||
url: commit.html_url,
|
||||
parentRepo: repo.full_name,
|
||||
parentBranch: 'main', // I know this is a shit solution
|
||||
user: commit.commit.author.name
|
||||
user: commit.commit.author.name,
|
||||
diff: {
|
||||
additions: commit.stats.additions,
|
||||
deletions: commit.stats.deletions,
|
||||
total: commit.stats.total
|
||||
}
|
||||
};
|
||||
commitList.push(newCommit);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user