fix err check and multi remote branch test

This commit is contained in:
Elian
2025-06-23 14:42:33 -07:00
parent 631de0075e
commit b244dfe7ac
2 changed files with 13 additions and 4 deletions

View File

@@ -558,10 +558,13 @@ func checkoutExistingBranchWithWorkingSetFallback(
}
err = checkoutExistingBranch(ctx, dbName, branchName, apr)
}
if err != nil {
if err != nil {
return err
}
} else if err != nil {
return err
}
return nil
}

View File

@@ -847,7 +847,7 @@ SQL
dolt checkout main
# Use explicit branch reference
# use explicit branch reference
dolt checkout feature --
# verify we switched to feature branch
@@ -1146,9 +1146,15 @@ SQL
echo "$output"
[[ "$output" =~ "'feature' matched multiple (2) remote tracking branches" ]] || false
run dolt checkout --track origin/feature
[ "$status" -eq 0 ]
echo "$output"
[[ "$output" =~ "Switched to branch 'feature'" ]] || false
[[ "$output" =~ "branch 'feature' set up to track 'origin/feature'" ]] || false
# verify we're still on main branch
run dolt branch
[ "$status" -eq 0 ]
[[ "$output" =~ "* main" ]] || false
[[ "$output" =~ "* feature" ]] || false
}