diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-22 11:51:46 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 09:32:42 -0600 |
commit | 75f5fa997de148c9bc0e5bd6e6f6050526a0b164 (patch) | |
tree | e2fd6db5b1190817c062a8df20018dd00be68ce0 /lib/gitlab/git | |
parent | 7d4b52b27dcbe30d85d4fad27e983cee51cf6677 (diff) | |
download | gitlab-ce-75f5fa997de148c9bc0e5bd6e6f6050526a0b164.tar.gz |
Enable Rails/Delegate
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r-- | lib/gitlab/git/commit.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/git/repository.rb | 14 |
2 files changed, 5 insertions, 13 deletions
diff --git a/lib/gitlab/git/commit.rb b/lib/gitlab/git/commit.rb index d785516ebdd..fd2b26c4a63 100644 --- a/lib/gitlab/git/commit.rb +++ b/lib/gitlab/git/commit.rb @@ -218,9 +218,7 @@ module Gitlab raw_commit.parents.map { |c| Gitlab::Git::Commit.new(c) } end - def tree - raw_commit.tree - end + delegate :tree, to: :raw_commit def stats Gitlab::Git::CommitStats.new(self) diff --git a/lib/gitlab/git/repository.rb b/lib/gitlab/git/repository.rb index 7068e68a855..e1fabff4e29 100644 --- a/lib/gitlab/git/repository.rb +++ b/lib/gitlab/git/repository.rb @@ -162,13 +162,9 @@ module Gitlab !empty? end - def empty? - rugged.empty? - end - - def bare? - rugged.bare? - end + delegate :empty?, + :bare?, + to: :rugged def repo_exists? !!rugged @@ -565,9 +561,7 @@ module Gitlab # will trigger a +:mixed+ reset and the working directory will be # replaced with the content of the index. (Untracked and ignored files # will be left alone) - def reset(ref, reset_type) - rugged.reset(ref, reset_type) - end + delegate :reset, to: :rugged # Mimic the `git clean` command and recursively delete untracked files. # Valid keys that can be passed in the +options+ hash are: |