Add improvements to merge request versions
* show commits count in the merge request version dropdown * initialize base/start commit sha for old merge request diffs from repo Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
parent
964742f600
commit
5cad2d2902
|
@ -34,7 +34,9 @@ class MergeRequestDiff < ActiveRecord::Base
|
|||
if persisted?
|
||||
# Workaround for old MergeRequestDiff object
|
||||
# that does not have head_commit_sha in the database
|
||||
self.head_commit_sha ||= last_commit.sha
|
||||
self.start_commit_sha ||= merge_request.target_branch_sha
|
||||
self.head_commit_sha ||= last_commit.sha
|
||||
self.base_commit_sha ||= find_base_sha
|
||||
else
|
||||
self.start_commit_sha ||= merge_request.target_branch_sha
|
||||
self.head_commit_sha ||= merge_request.source_branch_sha
|
||||
|
|
|
@ -20,8 +20,9 @@
|
|||
#{merge_request_diff.head_commit.short_id}
|
||||
%br
|
||||
%small
|
||||
#{number_with_delimiter(merge_request_diff.commits.count)} #{'commit'.pluralize(merge_request_diff.commits.count)},
|
||||
= time_ago_with_tooltip(merge_request_diff.created_at)
|
||||
|
||||
.pull-right
|
||||
%span.monospace
|
||||
git diff #{@merge_request_diff.base_commit.short_id}..#{@merge_request_diff.head_commit.short_id}
|
||||
#{@merge_request_diff.base_commit.short_id}..#{@merge_request_diff.head_commit.short_id}
|
||||
|
|
Loading…
Reference in New Issue