mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-06-10 23:28:58 +00:00
Fix ignoring strict.force and strict.commit.
This commit is contained in:
+9
-2
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user