diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-02-29 23:34:06 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-02-29 23:34:06 +0200 |
commit | 1924de91c58a429452edd97b181520abd9968bf7 (patch) | |
tree | e0d91cd7f825cee10279e129c662f40e09a253c2 | |
parent | f6f939eeb8e2864564942885e9254ca7670b75e7 (diff) | |
download | gitlab-ce-1924de91c58a429452edd97b181520abd9968bf7.tar.gz |
fixed compare for push
-rw-r--r-- | app/models/commit.rb | 4 | ||||
-rw-r--r-- | app/views/dashboard/_events_feed.html.haml | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 281e3f036e2..a59e880370a 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -56,4 +56,8 @@ class Commit def prev_commit parents.first end + + def prev_commit_id + prev_commit.id + end end diff --git a/app/views/dashboard/_events_feed.html.haml b/app/views/dashboard/_events_feed.html.haml index ae52fb8002b..e341319503e 100644 --- a/app/views/dashboard/_events_feed.html.haml +++ b/app/views/dashboard/_events_feed.html.haml @@ -12,8 +12,8 @@ = time_ago_in_words(event.created_at) ago. - if event.commits.count > 1 - = link_to compare_project_commits_path(event.project, :from => event.commits.last, :to => event.commits.first) do - Compare #{event.commits.last.id[0..8]}...#{event.commits.first.id[0..8]} + = link_to compare_project_commits_path(event.project, :from => event.commits.first.prev_commit_id, :to => event.commits.last.id) do + Compare #{event.commits.first.commit.id[0..8]}...#{event.commits.last.id[0..8]} - @project = event.project %ul.unstyled = render event.commits |