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
1
Merge Requests
1
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
nexedi
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
Show 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 @@
...
@@ -13,12 +13,13 @@
%pre
.dark
#merge-info-1
%pre
.dark
#merge-info-1
-
if
@merge_request
.
for_fork?
-
if
@merge_request
.
for_fork?
:preserve
:preserve
git fetch
#{
h
default_url_to_repo
(
@merge_request
.
source_project
)
}
#{
h
@merge_request
.
source_branch
}
-# All repo/branch refs have been quoted to allow support for special characters (such as #my-branch)
git checkout -b
#{
h
@merge_request
.
source_project_path
}
-
#{
h
@merge_request
.
source_branch
}
FETCH_HEAD
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
-
else
:preserve
:preserve
git fetch origin
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
%p
%strong
Step 2.
%strong
Step 2.
Review the changes locally
Review the changes locally
...
@@ -31,20 +32,20 @@
...
@@ -31,20 +32,20 @@
-
if
@merge_request
.
for_fork?
-
if
@merge_request
.
for_fork?
:preserve
:preserve
git fetch origin
git fetch origin
git checkout
origin/
#{
h
@merge_request
.
target_branch
}
git checkout
"origin/
#{
h
@merge_request
.
target_branch
}
"
git merge --no-ff
#{
h
@merge_request
.
source_project_path
}
-
#{
h
@merge_request
.
source_branch
}
git merge --no-ff
"
#{
h
@merge_request
.
source_project_path
}
-
#{
h
@merge_request
.
source_branch
}
"
-
else
-
else
:preserve
:preserve
git fetch origin
git fetch origin
git checkout
origin/
#{
h
@merge_request
.
target_branch
}
git checkout
"origin/
#{
h
@merge_request
.
target_branch
}
"
git merge --no-ff
#{
h
@merge_request
.
source_branch
}
git merge --no-ff
"
#{
h
@merge_request
.
source_branch
}
"
%p
%p
%strong
Step 4.
%strong
Step 4.
Push the result of the merge to GitLab
Push the result of the merge to GitLab
=
clipboard_button
(
target:
"pre#merge-info-4"
,
title:
"Copy commands to clipboard"
)
=
clipboard_button
(
target:
"pre#merge-info-4"
,
title:
"Copy commands to clipboard"
)
%pre
.dark
#merge-info-4
%pre
.dark
#merge-info-4
:preserve
: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
)
-
unless
@merge_request
.
can_be_merged_by?
(
current_user
)
%p
%p
Note that pushing to GitLab requires write access to this repository.
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
...
@@ -64,7 +64,7 @@ describe 'Merge request > User selects branches for new MR', :js do
click_button
"Check out branch"
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
end
it
'allows filtering multiple dropdowns'
do
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