From 6699a6db7001b3fb5cf49cba606e7b3306ed1c40 Mon Sep 17 00:00:00 2001 From: arun Date: Fri, 10 Jun 2016 20:40:00 +0530 Subject: [PATCH] OTWO-4267 Workaround to resolve 'git push fails:refusing to update checked out branch' --- lib/ohloh_scm/adapters/git/push.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ohloh_scm/adapters/git/push.rb b/lib/ohloh_scm/adapters/git/push.rb index bae4e69a..a8c8493a 100644 --- a/lib/ohloh_scm/adapters/git/push.rb +++ b/lib/ohloh_scm/adapters/git/push.rb @@ -10,7 +10,9 @@ def push(to) if to.exist? ENV['GIT_COMMITTER_NAME'] = COMMITTER_NAME + run "cd '#{to.url}' && git checkout -b tmp" run "cd '#{self.url}' && git push '#{to.url}' #{self.branch_name}:#{to.branch_name}" + run "cd '#{to.url}' && git checkout master && git branch -d tmp" else if to.local? # Create a new repo on the same local machine. Just use existing pull code in reverse.