зеркало из https://github.com/mislav/hub.git
Properly fix transform logic for push
This commit is contained in:
Родитель
1050c14af0
Коммит
2429680713
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче