Commit f46620e6f4d01e4a204dc79104a6934f43c707af

Authored by dosire
1 parent 09eccf47

Instead of working with remotes Dmitriy suggested to use urls.

app/views/projects/merge_requests/show/_how_to_merge.html.haml
@@ -10,23 +10,19 @@ @@ -10,23 +10,19 @@
10 - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path 10 - target_remote = @merge_request.target_project.namespace.nil? ? "target" :@merge_request.target_project.namespace.path
11 %p 11 %p
12 %strong Step 1. 12 %strong Step 1.
13 - Update the repo and checkout the branch we are going to merge  
14 - Assuming remote for #{@merge_request.target_project.path_with_namespace} is called #{target_remote}  
15 - remote for #{@merge_request.source_project_path} is called #{source_remote} 13 + Checkout the branch we are going to merge and pull in the code
16 %pre.dark 14 %pre.dark
17 :preserve 15 :preserve
18 - git fetch #{source_remote}  
19 - git fetch #{target_remote}  
20 - git checkout -b {@merge_request.source_branch} #{source_remote}/#{@merge_request.source_branch} 16 + git checkout -b #{@merge_request.source_project_path}-#{@merge_request.source_branch} #{@merge_request.target_branch}
  17 + git pull #{@merge_request.source_project.http_url_to_repo} #{@merge_request.source_branch}
21 %p 18 %p
22 %strong Step 2. 19 %strong Step 2.
23 - Merge the source branch into target branch and push changes to GitLab 20 + Merge the branch and push the changes to GitLab
24 %pre.dark 21 %pre.dark
25 :preserve 22 :preserve
26 - git checkout #{target_remote}/#{@merge_request.target_branch}  
27 - git merge --no-ff #{@merge_request.source_branch}  
28 - git push #{target_remote} #{@merge_request.target_branch}  
29 - git branch -d {@merge_request.source_branch} 23 + git checkout #{@merge_request.target_branch}
  24 + git merge --no-ff #{@merge_request.source_project_path}-#{@merge_request.source_branch}
  25 + git push origin #{@merge_request.target_branch}
30 - else 26 - else
31 %p 27 %p
32 %strong Step 1. 28 %strong Step 1.
@@ -34,10 +30,10 @@ @@ -34,10 +30,10 @@
34 %pre.dark 30 %pre.dark
35 :preserve 31 :preserve
36 git fetch origin 32 git fetch origin
37 - git checkout -b #{@merge_request.source_branch} 33 + git checkout -b #{@merge_request.source_branch} origin/#{@merge_request.source_branch}
38 %p 34 %p
39 %strong Step 2. 35 %strong Step 2.
40 - Merge the source branch into target branch and push changes to GitLab 36 + Merge the branch and push the changes to GitLab
41 %pre.dark 37 %pre.dark
42 :preserve 38 :preserve
43 git checkout #{@merge_request.target_branch} 39 git checkout #{@merge_request.target_branch}