提交 240141ce 编写于 作者: A Alex Kahn 提交者: Chris Wanstrath

Push to two remotes, e.g. git push origin,staging cool-feature

上级 8c5012b7
......@@ -89,6 +89,20 @@ module Hub
end
end
# $ hub push origin,staging cool-feature
# > git push origin cool-feature
# > git push other cool-feature
def push(args)
return unless args[1] =~ /,/
branch = args[2]
remotes = args[1].split(',')
args[1] = remotes.shift
while remotes.length > 0 do
args.after "git push #{remotes.shift} #{branch}"
end
end
def alias(args)
shells = {
'sh' => 'alias git=hub',
......
......@@ -84,6 +84,12 @@ class HubTest < Test::Unit::TestCase
assert_equal "** No GitHub user set. See http://github.com/guides/local-github-config\n", out
end
def test_push_two
h = Hub("push origin,staging cool-feature")
assert_equal "git push origin cool-feature", h.command
assert_equal "git push staging cool-feature", h.after
end
def test_version
out = hub('--version')
assert_includes "git version 1.6", out
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册