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
d84b0fa6
Commit
d84b0fa6
authored
Jan 13, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add merge_commit_message argument for Satellite::MergeAction#merge
parent
6a800832
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
9 deletions
+4
-9
lib/gitlab/satellite/merge_action.rb
lib/gitlab/satellite/merge_action.rb
+4
-9
No files found.
lib/gitlab/satellite/merge_action.rb
View file @
d84b0fa6
...
...
@@ -24,10 +24,10 @@ module Gitlab
# Returns false if the merge produced conflicts
# Returns false if pushing from the satellite to the repository failed or was rejected
# Returns true otherwise
def
merge!
def
merge!
(
merge_commit_message
=
nil
)
in_locked_and_timed_satellite
do
|
merge_repo
|
prepare_satellite!
(
merge_repo
)
if
merge_in_satellite!
(
merge_repo
)
if
merge_in_satellite!
(
merge_repo
,
merge_commit_message
)
# push merge back to bare repo
# will raise CommandFailed when push fails
merge_repo
.
git
.
push
(
default_options
,
:origin
,
merge_request
.
target_branch
)
...
...
@@ -114,16 +114,11 @@ module Gitlab
def
merge_in_satellite!
(
repo
,
message
=
nil
)
update_satellite_source_and_target!
(
repo
)
merge_message
=
"Merge branch '
#{
merge_request
.
source_branch
}
' into '
#{
merge_request
.
target_branch
}
'"
if
message
merge_message
<<
"
\n\n
"
merge_message
<<
message
end
message
||=
"Merge branch '
#{
merge_request
.
source_branch
}
' into '
#{
merge_request
.
target_branch
}
'"
# merge the source branch into the satellite
# will raise CommandFailed when merge fails
repo
.
git
.
merge
(
default_options
({
no_ff:
true
}),
"-m
#{
me
rge_me
ssage
}
"
,
"source/
#{
merge_request
.
source_branch
}
"
)
repo
.
git
.
merge
(
default_options
({
no_ff:
true
}),
"-m
#{
message
}
"
,
"source/
#{
merge_request
.
source_branch
}
"
)
rescue
Grit
::
Git
::
CommandFailed
=>
ex
handle_exception
(
ex
)
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