summaryrefslogtreecommitdiff
path: root/app/services/system_notes/commit_service.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-12-02 00:07:06 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-12-02 00:07:06 +0000
commitb26eec8cbcf32085079eee0e196456eccefc993f (patch)
tree822f69aeec23b0b3512583b2221000a8035241f7 /app/services/system_notes/commit_service.rb
parent61666f277a484725307ae2b34697b13a300b2129 (diff)
downloadgitlab-ce-b26eec8cbcf32085079eee0e196456eccefc993f.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/system_notes/commit_service.rb')
-rw-r--r--app/services/system_notes/commit_service.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/app/services/system_notes/commit_service.rb b/app/services/system_notes/commit_service.rb
index c89998f77c7..592351079aa 100644
--- a/app/services/system_notes/commit_service.rb
+++ b/app/services/system_notes/commit_service.rb
@@ -81,12 +81,10 @@ module SystemNotes
commit_ids = if count == 1
existing_commits.first.short_id
+ elsif oldrev && !Gitlab::Git.blank_ref?(oldrev)
+ "#{Commit.truncate_sha(oldrev)}...#{existing_commits.last.short_id}"
else
- if oldrev && !Gitlab::Git.blank_ref?(oldrev)
- "#{Commit.truncate_sha(oldrev)}...#{existing_commits.last.short_id}"
- else
- "#{existing_commits.first.short_id}..#{existing_commits.last.short_id}"
- end
+ "#{existing_commits.first.short_id}..#{existing_commits.last.short_id}"
end
commits_text = "#{count} commit".pluralize(count)