aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-11-19 20:20:19 +0100
committerMichael Muré <batolettre@gmail.com>2019-11-19 20:20:19 +0100
commit60427f066af7aefb806883809090120a9654331a (patch)
tree7fbfc1c3abd03aaa300ed54c92389ff4fa416b7e /commands
parent62fea2615d2bb870721b745a5dbe017772f20918 (diff)
downloadgit-bug-60427f066af7aefb806883809090120a9654331a.tar.gz
bridge configure: no default name if the default has already been created
Diffstat (limited to 'commands')
-rw-r--r--commands/bridge_configure.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/commands/bridge_configure.go b/commands/bridge_configure.go
index 12cc35e3..3562af17 100644
--- a/commands/bridge_configure.go
+++ b/commands/bridge_configure.go
@@ -94,8 +94,14 @@ func promptTarget() (string, error) {
}
func promptName(repo repository.RepoCommon) (string, error) {
+ defaultExist := core.BridgeExist(repo, defaultName)
+
for {
- fmt.Printf("name [%s]: ", defaultName)
+ if defaultExist {
+ fmt.Printf("name: ")
+ } else {
+ fmt.Printf("name [%s]: ", defaultName)
+ }
line, err := bufio.NewReader(os.Stdin).ReadString('\n')
if err != nil {
@@ -105,6 +111,10 @@ func promptName(repo repository.RepoCommon) (string, error) {
line = strings.TrimRight(line, "\n")
name := line
+ if defaultExist && name == "" {
+ continue
+ }
+
if name == "" {
name = defaultName
}