Browse files

It wasn't always honoring the remote repository name that was entered

  • Loading branch information...
1 parent 62a0e9c commit f556a91c45ee371d52184ccf6586e9c38ea273d5 @rhburrows committed Apr 12, 2010
Showing with 10 additions and 8 deletions.
  1. +2 −2 lib/reviewr/git.rb
  2. +8 −6 spec/reviewr/git_spec.rb
View
4 lib/reviewr/git.rb
@@ -43,7 +43,7 @@ def user_email
end
def push_branch(branch_name)
- execute("git push origin #{branch_name}")
+ execute("git push #{remote_repo} #{branch_name}")
end
def origin_location
@@ -52,7 +52,7 @@ def origin_location
end
def origin_master_commit
- r = execute("git ls-remote origin refs/heads/master")
+ r = execute("git ls-remote #{remote_repo} refs/heads/master")
r && r.split(/\s+/)[0]
end
View
14 spec/reviewr/git_spec.rb
@@ -58,16 +58,17 @@ module Reviewr
end
describe "#push_branch" do
- it "pushes the branch to origin" do
- git.should_receive(:execute).with('git push origin branch_name')
+ it "pushes the branch to the remote repo" do
+ git.remote_repo = "remote"
+ git.should_receive(:execute).with('git push remote branch_name')
git.push_branch("branch_name")
end
end
describe "#origin_location" do
it "runs show on the remote remote repo" do
- git.remote_repo = "origin"
- git.should_receive(:execute).with('git remote show origin')
+ git.remote_repo = "remote"
+ git.should_receive(:execute).with('git remote show remote')
git.origin_location
end
@@ -85,8 +86,9 @@ module Reviewr
end
describe "#origin_master_commit" do
- it "calls ls-remote on the origin master" do
- git.should_receive(:execute).with('git ls-remote origin refs/heads/master')
+ it "calls ls-remote on the remote master" do
+ git.remote_repo = 'remote'
+ git.should_receive(:execute).with('git ls-remote remote refs/heads/master')
git.origin_master_commit
end

0 comments on commit f556a91

Please sign in to comment.