Permalink
Browse files

Fixes for gitc pull and push with unknown branch

  • Loading branch information...
1 parent aa8c2ec commit 85ed7dfc1d870e7c206ea11dfec50e14a939f4c5 @winton committed Oct 21, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 lib/gitcycle.rb
View
@@ -271,14 +271,14 @@ def pull(*args)
if branch && branch['collab']
# Merge from collab
merge_remote_branch(
- :owner => branch['home'],
+ :owner => owner = branch['home'],
:repo => branch['repo']['name'],
:branch => branch['source']
)
elsif branch
# Merge from upstream source branch
merge_remote_branch(
- :owner => branch['repo']['owner'],
+ :owner => owner = branch['repo']['owner'],
:repo => branch['repo']['name'],
:branch => branch['source']
)
@@ -288,13 +288,13 @@ def pull(*args)
# Merge from upstream branch with same name
merge_remote_branch(
- :owner => repo['owner'],
+ :owner => owner = repo['owner'],
:repo => repo['name'],
:branch => current_branch
)
end
- unless branch && branch['collab']
+ unless branch && branch['collab'] || owner == @git_login
# Merge from origin
merge_remote_branch(
:owner => @git_login,
@@ -313,7 +313,7 @@ def push(*args)
branch = pull
- if branch['collab']
+ if branch && branch['collab']
puts "\nPushing branch '#{branch['home']}/#{branch['name']}'.\n".green
run("git push #{branch['home']} #{branch['name']} -q")
elsif branch

0 comments on commit 85ed7df

Please sign in to comment.