diff --git a/commands/push.go b/commands/push.go index c2880cd6..7e035d02 100644 --- a/commands/push.go +++ b/commands/push.go @@ -25,7 +25,7 @@ multiple git-push(1) commands.`, > git push origin HEAD */ func push(command *Command, args *Args) { - if !args.IsParamsEmpty() && !strings.Contains(args.FirstParam(), ",") { + if !args.IsParamsEmpty() && strings.Contains(args.FirstParam(), ",") { transformPushArgs(args) } } diff --git a/commands/push_test.go b/commands/push_test.go index 4b039b95..22d14e7c 100644 --- a/commands/push_test.go +++ b/commands/push_test.go @@ -5,6 +5,17 @@ import ( "testing" ) +func testPush(t *testing.T) { + args := NewArgs([]string{"push", "origin,staging,qa", "bert_timeout"}) + push(nil, args) + + cmds := args.Commands() + + assert.Equal(t, 3, len(cmds)) + assert.Equal(t, "git push origin bert_timeout", cmds[0].String()) + assert.Equal(t, "git push staging bert_timeout", cmds[1].String()) +} + func TestTransformPushArgs(t *testing.T) { args := NewArgs([]string{"push", "origin,staging,qa", "bert_timeout"}) transformPushArgs(args)