fix: filter source control commits by branch (#286)

This commit is contained in:
Chris Scott authored and GitHub committed 2026-06-27 09:36:03 -04:00
1 parent 8d93f2f1f9
commit bb1df259b6
6 files changed
+67 -11

No files matched your search

+2 -2
View File
@@ -84,7 +84,7 @@ export class GitService {
return this.getFileDiff(repoId, filePath, database, { includeStaged })
}
async getLog(repoId: number, database: Database, limit: number = 10): Promise<GitCommit[]> {
async getLog(repoId: number, database: Database, limit: number = 10, branch?: string): Promise<GitCommit[]> {
try {
const repo = getRepoById(database, repoId)
if (!repo) {
@@ -97,7 +97,7 @@ export class GitService {
'-C',
repoPath,
'log',
`--all`,
branch?.trim() || 'HEAD',
`-n`,
String(limit),
'--format=%H|%an|%ae|%at|%s'