Commit 3a6694b5516f4c5015a7745cf8182e74597b39ad
1 parent
5abbada4
Exists in
master
and in
4 other branches
Auto-merge: reise exception when gitlab do not have access to repo
Showing
1 changed file
with
3 additions
and
1 deletions
Show diff stats
lib/gitlab_merge.rb
| ... | ... | @@ -32,7 +32,9 @@ class GitlabMerge |
| 32 | 32 | f.flock(File::LOCK_EX) |
| 33 | 33 | |
| 34 | 34 | self.project.repo.git.clone({:branch => merge_request.target_branch}, project.url_to_repo, merge_path) |
| 35 | - #TODO When user do not have permissions then raise exception | |
| 35 | + unless File.exist?(self.merge_path) | |
| 36 | + raise "Gitlab user do not have access to repo. You should run: rake gitlab_enable_automerge" | |
| 37 | + end | |
| 36 | 38 | Dir.chdir(merge_path) do |
| 37 | 39 | merge_repo = Grit::Repo.new('.') |
| 38 | 40 | merge_repo.git.sh "git config user.name \"#{user.name}\"" | ... | ... |