summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-01-26 15:17:11 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-01-26 16:52:20 +1100
commitca7cfc32322f016a430ecbf87e3e638d1a02cfc1 (patch)
tree446d4160ba4162c575009cb4d79d38cf779427e9 /pkg/commands
parentdc765c416624d19e9d1c9a8aff10c75e08e30105 (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.go8
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
+}