diff --git a/lib/bummr/bisecter.rb b/lib/bummr/bisecter.rb index 394ce8f..38b78c3 100644 --- a/lib/bummr/bisecter.rb +++ b/lib/bummr/bisecter.rb @@ -5,12 +5,14 @@ class Bisecter def bisect puts "Bad commits found! Bisecting...".color(:red) + toplevel_path = `git rev-parse --show-toplevel`.chomp + system("bundle") - system("git bisect start") - system("git bisect bad") - system("git bisect good #{BASE_BRANCH}") + system("git -C #{toplevel_path} bisect start") + system("git -C #{toplevel_path} bisect bad") + system("git -C #{toplevel_path} bisect good #{BASE_BRANCH}") - Open3.popen2e("git bisect run #{TEST_COMMAND}") do |_std_in, std_out_err| + Open3.popen2e("git -C #{toplevel_path} bisect run #{TEST_COMMAND}") do |_std_in, std_out_err| while line = std_out_err.gets puts line