Skip to content

Commit 0d390e8

Browse files
authored
--bisect: ignore merge commit (#458)
1 parent 3713194 commit 0d390e8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/core.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,8 +734,13 @@ func cleanIfNeeded(bazelPath string, startupOptions []string) {
734734
}
735735
}
736736

737+
type ParentCommit struct {
738+
SHA string `json:"sha"`
739+
}
740+
737741
type Commit struct {
738742
SHA string `json:"sha"`
743+
PARENTS []ParentCommit `json:"parents"`
739744
}
740745

741746
type CompareResponse struct {
@@ -803,7 +808,10 @@ func getBazelCommitsBetween(goodCommit string, badCommit string) ([]string, erro
803808
}
804809

805810
for _, commit := range compareResponse.Commits {
806-
commitList = append(commitList, commit.SHA)
811+
// If it has only one parent commit, add it to the list, otherwise it's a merge commit and we ignore it
812+
if len(commit.PARENTS) == 1 {
813+
commitList = append(commitList, commit.SHA)
814+
}
807815
}
808816

809817
// Check if there are more commits to fetch

0 commit comments

Comments
 (0)