From b4aaced71a65faffd49ffa2c705fb574ed532701 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Mon, 21 Aug 2017 17:27:06 +0200 Subject: Fix display of push events for removed refs This changes the style of push events that remove tags or branches so they don't display the commit details. This prevents displaying commit details such as: 000000 . --broken encoding Instead we now simply display the header such as: Administrator deleted branch example-branch This is displayed in the same style as events for newly created branches/tags. This commit also ensures that if no commit message is present we simply don't display anything, instead of "--broken encoding". Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36685 Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/36722 --- spec/helpers/events_helper_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'spec/helpers') diff --git a/spec/helpers/events_helper_spec.rb b/spec/helpers/events_helper_spec.rb index 4b72dbb7964..d5536fcb22b 100644 --- a/spec/helpers/events_helper_spec.rb +++ b/spec/helpers/events_helper_spec.rb @@ -106,5 +106,9 @@ describe EventsHelper do it "handles empty strings" do expect(helper.event_commit_title("")).to eq("") end + + it 'handles nil values' do + expect(helper.event_commit_title(nil)).to eq('') + end end end -- cgit v1.2.1