mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-12 21:05:48 +02:00
specify upstream when pushing a branch for the first time
This commit is contained in:
parent
6843741d9e
commit
12b84307ac
10 changed files with 46 additions and 21 deletions
|
@ -990,7 +990,7 @@ func TestGitCommandPush(t *testing.T) {
|
|||
"Push with force disabled",
|
||||
func(cmd string, args ...string) *exec.Cmd {
|
||||
assert.EqualValues(t, "git", cmd)
|
||||
assert.EqualValues(t, []string{"push", "-u", "origin", "test"}, args)
|
||||
assert.EqualValues(t, []string{"push"}, args)
|
||||
|
||||
return exec.Command("echo")
|
||||
},
|
||||
|
@ -1003,7 +1003,7 @@ func TestGitCommandPush(t *testing.T) {
|
|||
"Push with force enabled",
|
||||
func(cmd string, args ...string) *exec.Cmd {
|
||||
assert.EqualValues(t, "git", cmd)
|
||||
assert.EqualValues(t, []string{"push", "--force-with-lease", "-u", "origin", "test"}, args)
|
||||
assert.EqualValues(t, []string{"push", "--force-with-lease"}, args)
|
||||
|
||||
return exec.Command("echo")
|
||||
},
|
||||
|
@ -1016,7 +1016,7 @@ func TestGitCommandPush(t *testing.T) {
|
|||
"Push with an error occurring",
|
||||
func(cmd string, args ...string) *exec.Cmd {
|
||||
assert.EqualValues(t, "git", cmd)
|
||||
assert.EqualValues(t, []string{"push", "-u", "origin", "test"}, args)
|
||||
assert.EqualValues(t, []string{"push"}, args)
|
||||
return exec.Command("test")
|
||||
},
|
||||
false,
|
||||
|
@ -1030,7 +1030,7 @@ func TestGitCommandPush(t *testing.T) {
|
|||
t.Run(s.testName, func(t *testing.T) {
|
||||
gitCmd := NewDummyGitCommand()
|
||||
gitCmd.OSCommand.command = s.command
|
||||
err := gitCmd.Push("test", s.forcePush, func(passOrUname string) string {
|
||||
err := gitCmd.Push("test", s.forcePush, "", func(passOrUname string) string {
|
||||
return "\n"
|
||||
})
|
||||
s.test(err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue