fix: avoid prompting for remotes in non-TTY

This commit is contained in:
Clement Sam 2022-10-18 01:16:30 +00:00
parent c5170d72fb
commit f4c9b6f20e
5 changed files with 17 additions and 17 deletions

View File

@ -4,7 +4,7 @@ import (
"crypto/tls"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/assert"
)
func Test_tlsConfig(t *testing.T) {
@ -41,7 +41,7 @@ func Test_tlsConfig(t *testing.T) {
client := tlsConfig(tt.args.host)
assert.Equal(t, tt.want, client.CipherSuites)
assert.Equal(t, tt.want, client.CipherSuites)
})
}
}

View File

@ -202,7 +202,7 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer) error {
}
printSubcommands(cmd, buf)
_, err := buf.WriteTo(w)
return err
}

View File

@ -716,7 +716,7 @@ func resolvedHeadRepo(f *cmdutils.Factory) func() (glrepo.Interface, error) {
if err != nil {
return nil, err
}
headRepo, err := repoContext.HeadRepo(true)
headRepo, err := repoContext.HeadRepo(f.IO.PromptEnabled())
if err != nil {
return nil, err
}

View File

@ -518,11 +518,11 @@ func Test_DisplayAllMRs(t *testing.T) {
Title: "add tests",
TargetBranch: "main",
SourceBranch: "new-tests",
References: &gitlab.IssueReferences{
Full: "OWNER/REPO/merge_requests/1",
References: &gitlab.IssueReferences{
Full: "OWNER/REPO/merge_requests/1",
Relative: "#1",
Short: "#1",
},
Short: "#1",
},
},
{
IID: 2,
@ -530,11 +530,11 @@ func Test_DisplayAllMRs(t *testing.T) {
Title: "fix bug",
TargetBranch: "main",
SourceBranch: "new-feature",
References: &gitlab.IssueReferences{
Full: "OWNER/REPO/merge_requests/2",
References: &gitlab.IssueReferences{
Full: "OWNER/REPO/merge_requests/2",
Relative: "#2",
Short: "#2",
},
Short: "#2",
},
},
{
IID: 1,
@ -542,11 +542,11 @@ func Test_DisplayAllMRs(t *testing.T) {
Title: "add new feature",
TargetBranch: "main",
SourceBranch: "new-tests",
References: &gitlab.IssueReferences{
Full: "OWNER/REPO/merge_requests/3",
References: &gitlab.IssueReferences{
Full: "OWNER/REPO/merge_requests/3",
Relative: "#3",
Short: "#3",
},
Short: "#3",
},
},
}

View File

@ -134,7 +134,7 @@ func resolvedBaseRepo(f *cmdutils.Factory) func() (glrepo.Interface, error) {
if err != nil {
return nil, err
}
baseRepo, err := repoContext.BaseRepo(true)
baseRepo, err := repoContext.BaseRepo(f.IO.PromptEnabled())
if err != nil {
return nil, err
}