Avoid changing the default branch when we check out tables, not a branch.

This commit is contained in:
Nick Tobey
2023-07-07 14:17:07 -07:00
parent 2218ab55ae
commit 65894d265a
+1 -1
View File
@@ -152,7 +152,7 @@ func (cmd CheckoutCmd) Exec(ctx context.Context, commandStr string, args []strin
cli.Println(message)
}
if dEnv != nil {
if dEnv != nil && strings.Contains(message, "Switched to branch") {
err := saveHeadBranch(dEnv.FS, branchName)
if err != nil {
cli.PrintErr(err)