Fix ignoring strict.force and strict.commit.

This commit is contained in:
2025-12-15 13:37:07 +00:00
parent 49a46a74c1
commit 3e0a7239c4
12 changed files with 63 additions and 266 deletions
+9 -2
View File
@@ -135,18 +135,25 @@ func ListCommits(repo *GitRepository) ([]CommitDetails, error) {
Debug("Listing commits", map[string]interface{}{"commits": tmpResults})
// Filter commits starting from the specified commit if provided
// Filter commits starting after the specified commit if provided
if repo.StartCommit != "" {
found := false
for commitId, cmt := range tmpResults {
if cmt.Hash == repo.StartCommit {
Debug("Found commit match", map[string]interface{}{
"commit": cmt.Hash,
"index": commitId,
})
repo.Commits = tmpResults[commitId:]
// Start from the commit AFTER the specified one
repo.Commits = tmpResults[commitId+1:]
found = true
break
}
}
if !found {
// If specified commit not found, use all commits
repo.Commits = tmpResults
}
} else {
repo.Commits = tmpResults
}