branch listing cmd

This commit is contained in:
daveberrys committed 2026-07-19 09:16:16 +08:00
1 parent f21745e063
commit e40387c817
2 files changed
+9 -3

No files matched your search

+7 -2
View File
@@ -12,8 +12,13 @@ var switchBranchCmd = &cobra.Command{
Short: "Switch to a specific branch",
Args: cobra.ExactArgs(1),
RunE: func(c *cobra.Command, args []string) error {
utils.RunGitSequence(false, []string{"switch", args[0]})
fmt.Printf("Switched to branch: %s\n", args[0])
if args[0] == "list" {
utils.RunGit(false, "branch")
} else {
utils.RunGitSequence(false, []string{"switch", args[0]})
fmt.Printf("Switched to branch: %s\n", args[0])
}
return nil
},
}