diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-08-08 14:27:22 +0000 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2017-08-08 14:27:22 +0000 |
| commit | 14391151832e0fdd709c08d0d3f704b47b1d4e4e (patch) | |
| tree | 270be924e37becffbfd418729f1f696acf3e12f9 /app/models/commit.rb | |
| parent | 2aa460de76840d469071f17df9433c614e700e6e (diff) | |
| parent | 3ce6f03f1437633c9328dc30aa5272a49368655b (diff) | |
| download | gitlab-ce-14391151832e0fdd709c08d0d3f704b47b1d4e4e.tar.gz | |
Merge branch 'gitaly-find-commit' into 'master'
Incorporate Gitaly's CommitService.FindCommit RPC
Closes gitaly#402
See merge request !13094
Diffstat (limited to 'app/models/commit.rb')
| -rw-r--r-- | app/models/commit.rb | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 7940733f557..638fddc5d3d 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -55,7 +55,8 @@ class Commit end def from_hash(hash, project) - new(Gitlab::Git::Commit.new(hash), project) + raw_commit = Gitlab::Git::Commit.new(project.repository.raw, hash) + new(raw_commit, project) end def valid_hash?(key) @@ -320,21 +321,11 @@ class Commit end def raw_diffs(*args) - if Gitlab::GitalyClient.feature_enabled?(:commit_raw_diffs) - Gitlab::GitalyClient::CommitService.new(project.repository).diff_from_parent(self, *args) - else - raw.diffs(*args) - end + raw.diffs(*args) end def raw_deltas - @deltas ||= Gitlab::GitalyClient.migrate(:commit_deltas) do |is_enabled| - if is_enabled - Gitlab::GitalyClient::CommitService.new(project.repository).commit_deltas(self) - else - raw.deltas - end - end + @deltas ||= raw.deltas end def diffs(diff_options = nil) |
