diff options
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 73583e9e7b7..aba21762126 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -4,24 +4,11 @@ class Commit include StaticModel extend ActiveModel::Naming - attr_accessor :commit - attr_accessor :head - attr_accessor :refs - - delegate :message, - :authored_date, - :committed_date, - :parents, - :sha, - :date, - :committer, - :author, - :message, - :diffs, - :tree, - :id, - :to_patch, - to: :commit + attr_accessor :commit, :head, :refs + + delegate :message, :authored_date, :committed_date, :parents, :sha, + :date, :committer, :author, :message, :diffs, :tree, :id, + :to_patch, to: :commit class << self def find_or_first(repo, commit_id = nil, root_ref) @@ -30,6 +17,7 @@ class Commit else repo.commits(root_ref).first end + Commit.new(commit) if commit end |