diff --git a/hotfix.rb b/hotfix.rb index 2249ff9..4a5fcc6 100755 --- a/hotfix.rb +++ b/hotfix.rb @@ -63,9 +63,6 @@ if ARGV[1] hotfix = BRANCH_PREFIX + ARGV[1] - # Checkout the branch to make sure we have it locally. - Git::run_safe("git checkout \"#{hotfix}\"") - Git::run_safe("git rebase --preserve-merges origin/#{hotfix}") else hotfix = Git::current_branch end @@ -74,6 +71,10 @@ description = Github::get_pull_request_description_from_api(hotfix, 'stable') + # Checkout the branch to make sure we have it locally. + Git::run_safe("git checkout \"#{hotfix}\"") + Git::run_safe("git rebase --preserve-merges origin/#{hotfix}") + # Merge into stable Git::run_safe("git checkout stable") # pull the latest changes and rebase the unpushed commits if any.