diff options
author | Nihad Abbasov <narkoz.2008@gmail.com> | 2012-09-26 23:20:36 -0700 |
---|---|---|
committer | Nihad Abbasov <narkoz.2008@gmail.com> | 2012-09-27 02:05:53 -0700 |
commit | 841e4fbd08d2d642c127506001a76a973ea3d536 (patch) | |
tree | 56a894ecdf3978bc3032daa8fae294dad897018d /app/models/commit.rb | |
parent | 2a4359a572c123d117988487f9bb29f4ae176ceb (diff) | |
download | gitlab-ce-841e4fbd08d2d642c127506001a76a973ea3d536.tar.gz |
cosmetical cleanup of models
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 |