diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-26 15:17:11 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-26 16:52:20 +1100 |
commit | ca7cfc32322f016a430ecbf87e3e638d1a02cfc1 (patch) | |
tree | 446d4160ba4162c575009cb4d79d38cf779427e9 /pkg/commands | |
parent | dc765c416624d19e9d1c9a8aff10c75e08e30105 (diff) |
only show commits from start ref if bad commit is reachable from there
Diffstat (limited to 'pkg/commands')
-rw-r--r-- | pkg/commands/git_commands/bisect.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/commands/git_commands/bisect.go b/pkg/commands/git_commands/bisect.go index 2e362af2a..c72eaee52 100644 --- a/pkg/commands/git_commands/bisect.go +++ b/pkg/commands/git_commands/bisect.go @@ -162,3 +162,11 @@ func (self *BisectCommands) IsDone() (bool, []string, error) { return done, candidates, nil } + +func (self *BisectCommands) ReachableFromStart(ref string, startRef string) bool { + err := self.cmd.New( + fmt.Sprintf("git merge-base --is-ancestor %s %s", startRef, ref), + ).Run() + + return err == nil +} |