summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-05-16 07:45:28 -0700
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-05-16 07:45:28 -0700
commitcaa065670ef8d360383d4bf3109483924b7adf38 (patch)
tree89a14bde7e6e9494bb370f076584854fea97ffb1
parent1b85cbc6d638e8ddbde1ebcb71cb9fc195fb3012 (diff)
parente5bbefc98025b1b9f67b8635807d43f60be55c30 (diff)
downloadgitlab-ce-caa065670ef8d360383d4bf3109483924b7adf38.tar.gz
Merge pull request #825 from demelziraptor/master
View project pages without master branch
-rw-r--r--app/models/commit.rb4
-rw-r--r--app/models/project/repository_trait.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb
index 263e2f74296..574f69bc213 100644
--- a/app/models/commit.rb
+++ b/app/models/commit.rb
@@ -23,11 +23,11 @@ class Commit
class << self
- def find_or_first(repo, commit_id = nil)
+ def find_or_first(repo, commit_id = nil, root_ref)
commit = if commit_id
repo.commit(commit_id)
else
- repo.commits.first
+ repo.commits(root_ref).first
end
Commit.new(commit) if commit
end
diff --git a/app/models/project/repository_trait.rb b/app/models/project/repository_trait.rb
index d8bdbf2403b..8757d844217 100644
--- a/app/models/project/repository_trait.rb
+++ b/app/models/project/repository_trait.rb
@@ -8,7 +8,7 @@ module Project::RepositoryTrait
end
def commit(commit_id = nil)
- Commit.find_or_first(repo, commit_id)
+ Commit.find_or_first(repo, commit_id, root_ref)
end
def fresh_commits(n = 10)