Modify push prompt on repo create when bare
This commit is contained in:
parent
8e63268aba
commit
7bcb063391
2 changed files with 7 additions and 2 deletions
|
|
@ -652,8 +652,13 @@ func createFromLocal(opts *CreateOptions) error {
|
|||
|
||||
// don't prompt for push if there are no commits
|
||||
if opts.Interactive && committed {
|
||||
msg := fmt.Sprintf("Would you like to push commits from the current branch to %q?", baseRemote)
|
||||
if repoType == bare {
|
||||
msg = fmt.Sprintf("Would you like to mirror all refs to %q?", baseRemote)
|
||||
}
|
||||
|
||||
var err error
|
||||
opts.Push, err = opts.Prompter.Confirm(fmt.Sprintf("Would you like to push commits from the current branch to %q?", baseRemote), true)
|
||||
opts.Push, err = opts.Prompter.Confirm(msg, true)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -452,7 +452,7 @@ func Test_createRun(t *testing.T) {
|
|||
switch message {
|
||||
case "Add a remote?":
|
||||
return true, nil
|
||||
case `Would you like to push commits from the current branch to "origin"?`:
|
||||
case `Would you like to mirror all refs to "origin"?`:
|
||||
return true, nil
|
||||
default:
|
||||
return false, fmt.Errorf("unexpected confirm prompt: %s", message)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue