summaryrefslogtreecommitdiff
path: root/app/models/repository.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/repository.rb')
-rw-r--r--app/models/repository.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/models/repository.rb b/app/models/repository.rb
index 588cabfbae0..cd33782a4cc 100644
--- a/app/models/repository.rb
+++ b/app/models/repository.rb
@@ -18,19 +18,25 @@ class Repository
end
def commit(id = nil)
- commit = raw_repository.commit(id)
+ commit = Gitlab::Git::Commit.find(raw_repository, id)
commit = Commit.new(commit) if commit
commit
end
def commits(ref, path = nil, limit = nil, offset = nil)
- commits = raw_repository.commits(ref, path, limit, offset)
+ commits = Gitlab::Git::Commit.where(
+ repo: raw_repository,
+ ref: ref,
+ path: path,
+ limit: limit,
+ offset: offset,
+ )
commits = Commit.decorate(commits) if commits.present?
commits
end
- def commits_between(target, source)
- commits = raw_repository.commits_between(target, source)
+ def commits_between(from, to)
+ commits = Gitlab::Git::Commit.between(raw_repository, from, to)
commits = Commit.decorate(commits) if commits.present?
commits
end