Skip to content

Commit

Permalink
fix(branch): confirm branch name when creating
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatybridge committed Apr 22, 2024
1 parent 86bf4fd commit 8a29e72
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/branches/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ import (

func Run(ctx context.Context, name, region string, fsys afero.Fs) error {
gitBranch := keys.GetGitBranchOrDefault("", fsys)
if len(name) == 0 {
if len(name) == 0 && len(gitBranch) > 0 {
title := fmt.Sprintf("Do you want to create a branch named %s?", utils.Aqua(gitBranch))
if shouldCreate := utils.NewConsole().PromptYesNo(title, true); !shouldCreate {
return context.Canceled
}
name = gitBranch
}

Expand Down

0 comments on commit 8a29e72

Please sign in to comment.