From 2ae652d70b25697f7db95d219491995a5e2a8f7f Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 7 Mar 2013 18:01:08 +0600 Subject: [PATCH 1/2] fixed updating pull code --- app/models/pull_request.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/pull_request.rb b/app/models/pull_request.rb index ae549e93e..7f3478620 100644 --- a/app/models/pull_request.rb +++ b/app/models/pull_request.rb @@ -177,7 +177,9 @@ class PullRequest < ActiveRecord::Base Dir.chdir(path) do system 'git', 'tag', '-d', from_ref, to_ref - system 'git fetch --tags' + system 'git fetch --tags -all' + system 'git fetch --all' + tags, head = repo.tags.map(&:name), to_project == from_project ? 'origin' : 'head' system 'git', 'checkout', to_ref unless tags.include? to_ref From 6c00085c847eaf0357d4d4a96abdebceab4ba70e Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 7 Mar 2013 18:22:48 +0600 Subject: [PATCH 2/2] change default base branch on create pull request --- app/controllers/projects/pull_requests_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/projects/pull_requests_controller.rb b/app/controllers/projects/pull_requests_controller.rb index c961ead4d..08dabf8e2 100644 --- a/app/controllers/projects/pull_requests_controller.rb +++ b/app/controllers/projects/pull_requests_controller.rb @@ -152,7 +152,7 @@ class Projects::PullRequestsController < Projects::BaseController @pull.issue.body = pull_params[:issue_attributes][:body].presence end @pull.from_project = @project - @pull.to_ref = (pull_params[:to_ref].presence if pull_params) || @pull.to_project.default_head(params[:treeish]) + @pull.to_ref = (pull_params[:to_ref].presence if pull_params) || @pull.to_project.default_head @pull.from_ref = params[:treeish].presence || (pull_params[:from_ref].presence if pull_params) || @pull.from_project.default_head(params[:treeish]) @pull.from_project_owner_uname = @pull.from_project.owner.uname @pull.from_project_name = @pull.from_project.name