public
Rubygem
Description: The official `github` command line helper for simplifying your GitHub experience.
Homepage: http://github.com
Clone URL: git://github.com/defunkt/github-gem.git
Fix the git track remote user/repo syntax and add specs for it
kballard (author)
Fri Jun 13 17:06:54 -0700 2008
commit  33354f27bd4d88eb1922f767e8c61b2691827edc
tree    5397400ac0c39107ab2e7f58ec65f9e42895d877
parent  e84f46fa6ac9e8b6650609de8420efc159cda44b
...
52
53
54
 
55
56
57
 
58
59
 
60
61
62
...
52
53
54
55
56
57
 
58
59
 
60
61
62
63
0
@@ -52,11 +52,12 @@ command :track do |remote, user|
0
   die "Already tracking #{user}" if helper.tracking?(user)
0
   repo = @helper.project if repo.nil?
0
   repo.chomp!(".git")
0
+ remote ||= user
0
 
0
   if options[:private] || options[:ssh]
0
- git "remote add #{user} #{helper.private_url_for_user_and_repo(user, repo)}"
0
+ git "remote add #{remote} #{helper.private_url_for_user_and_repo(user, repo)}"
0
   else
0
- git "remote add #{user} #{helper.public_url_for_user_and_repo(user, repo)}"
0
+ git "remote add #{remote} #{helper.public_url_for_user_and_repo(user, repo)}"
0
   end
0
 end
0
 
...
139
140
141
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
143
144
...
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
0
@@ -139,6 +139,24 @@ EOF
0
     end
0
   end
0
 
0
+ specify "track origin defunkt/github-gem should track defunkt/github-gem as the origin remote" do
0
+ running :track, "origin", "defunkt/github-gem" do
0
+ @helper.stub!(:url_for).with(:origin).and_return ""
0
+ @helper.stub!(:tracking?).and_return false
0
+ @command.should_receive(:git).with("remote add origin git://github.com/defunkt/github-gem.git")
0
+ stderr.should_not =~ /^Error/
0
+ end
0
+ end
0
+
0
+ specify "track --private origin defunkt/github-gem should track defunkt/github-gem as the origin remote using ssh" do
0
+ running :track, "--private", "origin", "defunkt/github-gem" do
0
+ @helper.stub!(:url_for).with(:origin).and_return ""
0
+ @helper.stub!(:tracking?).and_return false
0
+ @command.should_receive(:git).with("remote add origin git@github.com:defunkt/github-gem.git")
0
+ stderr.should_not =~ /^Error/
0
+ end
0
+ end
0
+
0
   # -- pull --
0
   specify "pull should die with no args" do
0
     running :pull do

Comments

    No one has commented yet.