From e5bbefc98025b1b9f67b8635807d43f60be55c30 Mon Sep 17 00:00:00 2001 From: Demelziraptor Date: Wed, 16 May 2012 14:34:10 +0100 Subject: change find_or_first to work with default branch --- app/models/commit.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/models/commit.rb') 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 -- cgit v1.2.1