aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/github
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-05-25 15:56:52 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-05-29 22:58:01 +0200
commit0de2bd92b034ec265dbc66751626b4db67983760 (patch)
tree295e60b84216e06d55a48d590de6fff9a1dc4497 /bridge/github
parent46ce1059b6977d79b37477f02f2a5028ed4f09b0 (diff)
downloadgit-bug-0de2bd92b034ec265dbc66751626b4db67983760.tar.gz
Launchpad bridge configuration from `BridgeParams` Project and URL
Improve Github config comments
Diffstat (limited to 'bridge/github')
-rw-r--r--bridge/github/config.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/bridge/github/config.go b/bridge/github/config.go
index f2ac750e..e723fda6 100644
--- a/bridge/github/config.go
+++ b/bridge/github/config.go
@@ -42,25 +42,27 @@ func (*Github) Configure(repo repository.RepoCommon, params core.BridgeParams) (
var owner string
var project string
- // getting owner and project name:
- // first use directly params if they are both provided, else try to parse
- // them from params URL, and finaly try getting them from terminal prompt
+ // getting owner and project name
if params.Owner != "" && params.Project != "" {
+ // first try to use params if they are both provided
owner = params.Owner
project = params.Project
} else if params.URL != "" {
+ // try to parse them from params URL
_, owner, project, err = splitURL(params.URL)
if err != nil {
return nil, err
}
} else {
+ // remote suggestions
remotes, err := repo.GetRemotes()
if err != nil {
return nil, err
}
+ // try terminal prompt
owner, project, err = promptURL(remotes)
if err != nil {
return nil, err