diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2017-08-22 14:05:36 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2017-08-23 11:45:20 +0300 |
commit | 9b9309329207449ef022bdcf06bff5f8eae36032 (patch) | |
tree | a26840a279259159a0f0eddf6865fb57589d40bd /app/services/git_operation_service.rb | |
parent | 0f74ba967296cfb2e2ae65328f93170f453ab687 (diff) |
Decouple GitOperationService from User
Diffstat (limited to 'app/services/git_operation_service.rb')
-rw-r--r-- | app/services/git_operation_service.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/services/git_operation_service.rb b/app/services/git_operation_service.rb index 545ca0742e4..f7fce3d8a5d 100644 --- a/app/services/git_operation_service.rb +++ b/app/services/git_operation_service.rb @@ -1,8 +1,11 @@ class GitOperationService - attr_reader :user, :repository + attr_reader :committer, :repository - def initialize(new_user, new_repository) - @user = new_user + def initialize(committer, new_repository) + if committer && !committer.is_a?(Gitlab::Git::Committer) + raise "expected Gitlab::Git::Committer, got #{committer.inspect}" + end + @committer = committer @repository = new_repository end @@ -119,7 +122,7 @@ class GitOperationService def with_hooks(ref, newrev, oldrev) GitHooksService.new.execute( - user, + committer, repository.project, oldrev, newrev, |