Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make --ssh a synonym for --private for github track

  • Loading branch information...
commit e84f46fa6ac9e8b6650609de8420efc159cda44b 1 parent 7f39a5c
@kballard kballard authored
Showing with 13 additions and 4 deletions.
  1. +2 −1  commands/commands.rb
  2. +11 −3 spec/ui_spec.rb
View
3  commands/commands.rb
@@ -40,6 +40,7 @@
desc "Track another user's repository."
flags :private => "Use git@github.com: instead of git://github.com/."
+flags :ssh => 'Equivalent to --private'
command :track do |remote, user|
# track remote user
# track remote user/repo
@@ -52,7 +53,7 @@
repo = @helper.project if repo.nil?
repo.chomp!(".git")
- if options[:private]
+ if options[:private] || options[:ssh]
git "remote add #{user} #{helper.private_url_for_user_and_repo(user, repo)}"
else
git "remote add #{user} #{helper.public_url_for_user_and_repo(user, repo)}"
View
14 spec/ui_spec.rb
@@ -89,11 +89,19 @@
end
end
- specify "track --private defunkt should track a new remove for defunkt using ssh" do
+ specify "track --private defunkt should track a new remote for defunkt using ssh" do
running :track, "--private", "defunkt" do
setup_url_for
- @helper.should_receive(:tracking?).with("defunkt").once.and_return(false)
- @command.should_receive(:git).with("remote add defunkt git@github.com:defunkt/project.git").once
+ @helper.should_receive(:tracking?).with("defunkt").and_return(false)
+ @command.should_receive(:git).with("remote add defunkt git@github.com:defunkt/project.git")
+ end
+ end
+
+ specify "track --ssh defunkt should be equivalent to track --private defunkt" do
+ running :track, "--ssh", "defunkt" do
+ setup_url_for
+ @helper.should_receive(:tracking?).with("defunkt").and_return(false)
+ @command.should_receive(:git).with("remote add defunkt git@github.com:defunkt/project.git")
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.