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
ae93ac20
Commit
ae93ac20
authored
Jan 06, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify squashing in merge service
parent
ab9380d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
app/services/merge_requests/merge_service.rb
app/services/merge_requests/merge_service.rb
+16
-10
No files found.
app/services/merge_requests/merge_service.rb
View file @
ae93ac20
...
...
@@ -24,17 +24,9 @@ module MergeRequests
return
error
(
message
)
end
if
merge_request
.
squash
squash_result
=
SquashService
.
new
(
project
,
current_user
,
params
).
execute
(
merge_request
)
@source
=
find_merge_source
if
squash_result
[
:success
]
@source
=
squash_result
[
:squash_oid
]
else
log_merge_error
(
'Squashing this merge request failed'
,
true
)
end
else
@source
=
merge_request
.
diff_head_sha
end
return
log_merge_error
(
'No source for merge'
,
true
)
unless
@source
merge_request
.
in_locked_state
do
if
commit
...
...
@@ -119,5 +111,19 @@ module MergeRequests
"
#{
project
.
to_reference
}#{
merge_request
.
to_reference
}
"
end
def
find_merge_source
return
merge_request
.
diff_head_sha
unless
merge_request
.
squash
squash_result
=
SquashService
.
new
(
project
,
current_user
,
params
).
execute
(
merge_request
)
if
squash_result
[
:status
]
==
:success
squash_result
[
:squash_sha
]
else
log_merge_error
(
"Squashing
#{
merge_request_info
}
failed"
)
nil
end
end
end
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