diff options
author | Zevs <vsv2711@gmail.com> | 2012-04-30 00:23:19 +0300 |
---|---|---|
committer | Zevs <vsv2711@gmail.com> | 2012-04-30 00:23:19 +0300 |
commit | c937d06c3c98e9ffce8ec1132203eaff6bf7b231 (patch) | |
tree | 4e49537dd64ccb0dc5938ae23dbefd8bca4791ca /lib | |
parent | 903f9491ba097909f7d2e66873ff25d1505df07e (diff) | |
download | gitlab-ce-c937d06c3c98e9ffce8ec1132203eaff6bf7b231.tar.gz |
Task#755 auto-merge don`t work correctly.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab_merge.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab_merge.rb b/lib/gitlab_merge.rb index 3bc9ac378c5..2ca7b26d865 100644 --- a/lib/gitlab_merge.rb +++ b/lib/gitlab_merge.rb @@ -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}\"" |