Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
a8501a23
Commit
a8501a23
authored
Sep 06, 2019
by
Lee Tickett
Committed by
Nick Thomas
Sep 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Quote branch names in how to merge instructions
parent
bc06e9cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
9 deletions
+15
-9
app/views/projects/merge_requests/_how_to_merge.html.haml
app/views/projects/merge_requests/_how_to_merge.html.haml
+9
-8
changelogs/unreleased/quote-branch-names-in-instructions.yml
changelogs/unreleased/quote-branch-names-in-instructions.yml
+5
-0
spec/features/merge_request/user_selects_branches_for_new_mr_spec.rb
...es/merge_request/user_selects_branches_for_new_mr_spec.rb
+1
-1
No files found.
app/views/projects/merge_requests/_how_to_merge.html.haml
View file @
a8501a23
...
...
@@ -13,12 +13,13 @@
%pre
.dark
#merge-info-1
-
if
@merge_request
.
for_fork?
:preserve
git fetch
#{
h
default_url_to_repo
(
@merge_request
.
source_project
)
}
#{
h
@merge_request
.
source_branch
}
git checkout -b
#{
h
@merge_request
.
source_project_path
}
-
#{
h
@merge_request
.
source_branch
}
FETCH_HEAD
-# All repo/branch refs have been quoted to allow support for special characters (such as #my-branch)
git fetch "
#{
h
default_url_to_repo
(
@merge_request
.
source_project
)
}
" "
#{
h
@merge_request
.
source_branch
}
"
git checkout -b "
#{
h
@merge_request
.
source_project_path
}
-
#{
h
@merge_request
.
source_branch
}
" FETCH_HEAD
-
else
:preserve
git fetch origin
git checkout -b
#{
h
@merge_request
.
source_branch
}
origin/
#{
h
@merge_request
.
source_branch
}
git checkout -b
"
#{
h
@merge_request
.
source_branch
}
" "origin/
#{
h
@merge_request
.
source_branch
}
"
%p
%strong
Step 2.
Review the changes locally
...
...
@@ -31,20 +32,20 @@
-
if
@merge_request
.
for_fork?
:preserve
git fetch origin
git checkout
origin/
#{
h
@merge_request
.
target_branch
}
git merge --no-ff
#{
h
@merge_request
.
source_project_path
}
-
#{
h
@merge_request
.
source_branch
}
git checkout
"origin/
#{
h
@merge_request
.
target_branch
}
"
git merge --no-ff
"
#{
h
@merge_request
.
source_project_path
}
-
#{
h
@merge_request
.
source_branch
}
"
-
else
:preserve
git fetch origin
git checkout
origin/
#{
h
@merge_request
.
target_branch
}
git merge --no-ff
#{
h
@merge_request
.
source_branch
}
git checkout
"origin/
#{
h
@merge_request
.
target_branch
}
"
git merge --no-ff
"
#{
h
@merge_request
.
source_branch
}
"
%p
%strong
Step 4.
Push the result of the merge to GitLab
=
clipboard_button
(
target:
"pre#merge-info-4"
,
title:
"Copy commands to clipboard"
)
%pre
.dark
#merge-info-4
:preserve
git push origin
#{
h
@merge_request
.
target_branch
}
git push origin
"
#{
h
@merge_request
.
target_branch
}
"
-
unless
@merge_request
.
can_be_merged_by?
(
current_user
)
%p
Note that pushing to GitLab requires write access to this repository.
...
...
changelogs/unreleased/quote-branch-names-in-instructions.yml
0 → 100644
View file @
a8501a23
---
title
:
Quote branch names in how to merge instructions
merge_request
:
32639
author
:
Lee Tickett
type
:
fixed
spec/features/merge_request/user_selects_branches_for_new_mr_spec.rb
View file @
a8501a23
...
...
@@ -64,7 +64,7 @@ describe 'Merge request > User selects branches for new MR', :js do
click_button
"Check out branch"
expect
(
page
).
to
have_content
'git checkout -b
orphaned-branch origin/orphaned-branch
'
expect
(
page
).
to
have_content
'git checkout -b
"orphaned-branch" "origin/orphaned-branch"
'
end
it
'allows filtering multiple dropdowns'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment