WIP: push default defaults to simple
This commit is contained in:
parent
a72bef9b42
commit
6355ed7c08
1 changed files with 11 additions and 1 deletions
|
|
@ -59,7 +59,17 @@ func NewFinder(factory *cmdutil.Factory) PRFinder {
|
|||
remotesFn: factory.Remotes,
|
||||
httpClient: factory.HttpClient,
|
||||
pushDefault: func() (string, error) {
|
||||
return factory.GitClient.Config(context.Background(), "push.default")
|
||||
pushDefault, err := factory.GitClient.Config(context.Background(), "push.default")
|
||||
if err == nil {
|
||||
return pushDefault, nil
|
||||
}
|
||||
|
||||
var gitErr *git.GitError
|
||||
if ok := errors.As(err, &gitErr); ok && gitErr.ExitCode == 1 {
|
||||
return "simple", nil
|
||||
}
|
||||
|
||||
return "", err
|
||||
},
|
||||
progress: factory.IOStreams,
|
||||
branchConfig: func(s string) (git.BranchConfig, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue