Skip to content

Commit

Permalink
Fix remote and upstream branch if upstream isn't <remote>/<branch>
Browse files Browse the repository at this point in the history
Fixes #7

[Bump after signing cla]
  • Loading branch information
zenspider committed May 10, 2021
1 parent 8923666 commit b677645
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/git_chain/commands/push.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def run(options)
branch_remote, upstream_branch = upstream.split("/", 2)
if remote && branch_remote != remote
raise(Abort, "Multiple remotes detected: #{remote}, #{branch_remote}") if remote != branch_remote
else
elsif upstream_branch
remote = branch_remote
end
upstreams[b] = upstream_branch
elsif options[:set_upstream]
upstreams[b] = b
end

upstreams[b] ||= b if options[:set_upstream]
end

raise(Abort, "Nothing to push") if upstreams.empty?
Expand Down

0 comments on commit b677645

Please sign in to comment.