Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

checkout back when good or bad are invalid in gm repo bisect #165

Merged
merged 2 commits into from
Jan 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions pkgs/nu-git-manager-sugar/nu-git-manager-sugar/git/mod.nu
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,14 @@ export def "gm repo bisect" [
if not $no_check {
print $"checking that ($good) is good..."
^git checkout $good
try {
do $test
} catch {
let is_good = try {
do $test
true
} catch {
false
}
^git checkout -
if not $is_good {
throw-error {
msg: "invalid_good_revision",
text: "not a good revision",
Expand All @@ -416,13 +421,14 @@ export def "gm repo bisect" [

print $"checking that ($bad) is bad..."
^git checkout $bad
let res = try {
let is_good = try {
do $test
true
} catch {
false
}
if $res {
^git checkout -
if $is_good {
throw-error {
msg: "invalid_bad_revision",
text: "not a bad revision",
Expand Down
Loading