aboutsummaryrefslogtreecommitdiff
path: root/packages/server/src/routes/api/v1/repo/map.ts
blob: 520161ebb59225ed2637a89b94f7a31bd795db0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { Commit } from "../../../../git/commit";
import { LogCommit } from "api";

export async function commitMap(commit: Commit): Promise<LogCommit> {
	const stats = await commit.stats();
	return <LogCommit>{
		id: commit.id,
		author: {
			name: commit.author.name,
			email: commit.author.email
		},
		message: commit.message,
		date: commit.date,
		insertions: stats.insertions,
		deletions: stats.deletions,
		files_changed: stats.files_changed
	};
}