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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
d6ed9920
Commit
d6ed9920
authored
Jun 05, 2012
by
Zevs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#888 prevent to remove source_branch
parent
3b41b183
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
4 deletions
+9
-4
app/models/merge_request.rb
app/models/merge_request.rb
+1
-1
app/models/project/repository_trait.rb
app/models/project/repository_trait.rb
+4
-0
app/views/merge_requests/show.html.haml
app/views/merge_requests/show.html.haml
+3
-2
lib/gitlab/merge.rb
lib/gitlab/merge.rb
+1
-1
No files found.
app/models/merge_request.rb
View file @
d6ed9920
...
...
@@ -189,7 +189,7 @@ class MergeRequest < ActiveRecord::Base
self
.
merge!
(
current_user
.
id
)
true
end
rescue
rescue
self
.
mark_as_unmergable
false
end
...
...
app/models/project/repository_trait.rb
View file @
d6ed9920
...
...
@@ -114,5 +114,9 @@ module Project::RepositoryTrait
def
root_ref
default_branch
||
"master"
end
def
root_ref?
branch
root_ref
==
branch
end
end
end
app/views/merge_requests/show.html.haml
View file @
d6ed9920
...
...
@@ -65,8 +65,9 @@
=
form_for
[
:automerge
,
@project
,
@merge_request
],
:remote
=>
true
,
:method
=>
:get
do
|
f
|
You can accept this request automatically. If you still want to do it manually -
#{
link_to
"click here"
,
"#"
,
:class
=>
"how_to_merge_link vlink"
,
:title
=>
"How To Merge"
}
for instructions
%br
=
check_box_tag
:should_remove_source_branch
=
label_tag
:should_remove_source_branch
,
"Remove source-branch"
-
unless
@project
.
root_ref?
@merge_request
.
source_branch
=
check_box_tag
:should_remove_source_branch
=
label_tag
:should_remove_source_branch
,
"Remove source-branch"
=
f
.
submit
"Accept Merge Request"
,
:class
=>
"btn small info accept_merge_request"
...
...
lib/gitlab/merge.rb
View file @
d6ed9920
...
...
@@ -50,7 +50,7 @@ module Gitlab
output
=
merge_repo
.
git
.
pull
({},
"--no-ff"
,
"origin"
,
merge_request
.
source_branch
)
#remove source-branch
if
merge_request
.
should_remove_source_branch
if
merge_request
.
should_remove_source_branch
&&
!
project
.
root_ref?
(
merge_request
.
source_branch
)
merge_repo
.
git
.
sh
"git push origin :
#{
merge_request
.
source_branch
}
"
end
...
...
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