summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2012-04-16 23:49:57 +0300
committerValery Sizov <vsv2711@gmail.com>2012-04-16 23:49:57 +0300
commit3a6694b5516f4c5015a7745cf8182e74597b39ad (patch)
tree6aae63bc49ef1b949134a10987866dcbb738ad23 /lib
parent5abbada41e101ff832d036d5d1946d6f89fda771 (diff)
downloadgitlab-ce-3a6694b5516f4c5015a7745cf8182e74597b39ad.tar.gz
Auto-merge: reise exception when gitlab do not have access to repo
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab_merge.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab_merge.rb b/lib/gitlab_merge.rb
index 95942d5ca50..66a0e7ec635 100644
--- a/lib/gitlab_merge.rb
+++ b/lib/gitlab_merge.rb
@@ -32,7 +32,9 @@ class GitlabMerge
f.flock(File::LOCK_EX)
self.project.repo.git.clone({:branch => merge_request.target_branch}, project.url_to_repo, merge_path)
- #TODO When user do not have permissions then raise exception
+ unless File.exist?(self.merge_path)
+ raise "Gitlab user do not have access to repo. You should run: rake gitlab_enable_automerge"
+ end
Dir.chdir(merge_path) do
merge_repo = Grit::Repo.new('.')
merge_repo.git.sh "git config user.name \"#{user.name}\""