mirror of https://gitlab.com/gitlab-org/cli.git
fix: avoid prompting for remotes in non-TTY
This commit is contained in:
parent
c5170d72fb
commit
f4c9b6f20e
|
@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -202,7 +202,7 @@ func GenMarkdownCustom(cmd *cobra.Command, w io.Writer) error {
|
|||
}
|
||||
|
||||
printSubcommands(cmd, buf)
|
||||
|
||||
|
||||
_, err := buf.WriteTo(w)
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue