Skip to content

Commit

Permalink
No longer removing and re-adding remotes that already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
winton committed Oct 4, 2012
1 parent eb4e515 commit 0e64f93
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion features/push.feature
Expand Up @@ -15,7 +15,6 @@ Scenario: Collaborator
Then output includes
"""
Retrieving branch information from gitcycle.
Adding remote repo 'config.owner/config.repo'.
Fetching remote 'config.owner'.
Merging remote branch 'master-ticket.id' from 'config.owner/config.repo'.
Pushing branch 'config.owner/master-ticket.id'.
Expand Down
2 changes: 0 additions & 2 deletions features/qa.feature
Expand Up @@ -62,7 +62,6 @@ Scenario: QA issue pass w/ issue number
Pushing branch 'qa_master_config.user'.
Retrieving branch information from gitcycle.
Checking out branch 'master'.
Adding remote repo 'config.owner/config.repo'.
Fetching remote 'config.owner'.
Merging remote branch 'qa_master_config.user' from 'config.owner/config.repo'.
Pushing branch 'master'.
Expand All @@ -78,7 +77,6 @@ Scenario: QA issue pass
"""
Retrieving branch information from gitcycle.
Checking out branch 'master'.
Adding remote repo 'config.owner/config.repo'.
Fetching remote 'config.owner'.
Merging remote branch 'qa_master_config.user' from 'config.owner/config.repo'.
Pushing branch 'master'.
Expand Down
4 changes: 0 additions & 4 deletions features/ready.feature
Expand Up @@ -12,7 +12,6 @@ Scenario: Ready issue
Then output includes
"""
Retrieving branch information from gitcycle.
Adding remote repo 'config.owner/config.repo'.
Fetching remote 'config.owner'.
Merging remote branch 'master' from 'config.owner/config.repo'.
Adding remote repo 'config.user/config.repo'.
Expand Down Expand Up @@ -48,10 +47,8 @@ Scenario: Reopen pull request
Then output includes
"""
Retrieving branch information from gitcycle.
Adding remote repo 'config.owner/config.repo'.
Fetching remote 'config.owner'.
Merging remote branch 'master' from 'config.owner/config.repo'.
Adding remote repo 'config.user/config.repo'.
Fetching remote 'config.user'.
Merging remote branch 'master-ticket.id' from 'config.user/config.repo'.
Creating GitHub pull request.
Expand Down Expand Up @@ -79,7 +76,6 @@ Scenario: Collaborator
Then output includes
"""
Retrieving branch information from gitcycle.
Adding remote repo 'config.owner/config.repo'.
Fetching remote 'config.owner'.
Merging remote branch 'some_branch' from 'config.owner/gitcycle_test'.
Pushing branch 'config.owner/some_branch'.
Expand Down
7 changes: 4 additions & 3 deletions lib/gitcycle.rb
Expand Up @@ -536,9 +536,10 @@ def add_remote_and_fetch(options={})
unless $remotes[owner]
$remotes[owner] = true

puts "Adding remote repo '#{owner}/#{repo}'.\n".green
run("git remote rm #{owner}") if remotes(:match => owner)
run("git remote add #{owner} git@github.com:#{owner}/#{repo}.git")
unless remotes(:match => owner)
puts "Adding remote repo '#{owner}/#{repo}'.\n".green
run("git remote add #{owner} git@github.com:#{owner}/#{repo}.git")
end

puts "Fetching remote '#{owner}'.\n".green
run("git fetch -q #{owner}")
Expand Down

0 comments on commit 0e64f93

Please sign in to comment.