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
iv
gitlab-ce
Commits
c937d06c
Commit
c937d06c
authored
Apr 30, 2012
by
Zevs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Task#755 auto-merge don`t work correctly.
parent
903f9491
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
lib/gitlab_merge.rb
lib/gitlab_merge.rb
+5
-2
No files found.
lib/gitlab_merge.rb
View file @
c937d06c
...
...
@@ -8,14 +8,16 @@ class GitlabMerge
end
def
can_be_merged?
result
=
false
process
do
|
repo
,
output
|
!
(
output
=~
/Automatic merge failed
/
)
result
=
!
(
output
=~
/CONFLICT
/
)
end
result
end
def
merge
process
do
|
repo
,
output
|
if
output
=~
/
Automatic merge failed
/
if
output
=~
/
CONFLICT
/
false
else
repo
.
git
.
push
({},
"origin"
,
merge_request
.
target_branch
)
...
...
@@ -39,6 +41,7 @@ class GitlabMerge
Dir
.
chdir
(
project
.
satellite
.
path
)
do
merge_repo
=
Grit
::
Repo
.
new
(
'.'
)
merge_repo
.
git
.
sh
"git reset --hard"
merge_repo
.
git
.
sh
"git fetch origin"
merge_repo
.
git
.
sh
"git config user.name
\"
#{
user
.
name
}
\"
"
merge_repo
.
git
.
sh
"git config user.email
\"
#{
user
.
email
}
\"
"
...
...
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