Skip to content

Commit 2191cbf

Browse files
author
Ahmet Sezgin Duran
committed
TB-46 #time 5m Fix condition errors
1 parent 544b0ea commit 2191cbf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/katip/change_logger.rb

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,8 @@ def parse_change_log
5656
tags = tags.split
5757
prev_begin = nil
5858

59-
if !tags.include?(@tag_from) or !tags.include?(@tag_to)
60-
puts 'Could not find the given tags. Make sure that both of tags exist.'
61-
puts 'Listing found tags:'
62-
puts tags
59+
if (!@tag_from.nil? && !tags.include?(@tag_from)) || (!@tag_to.nil? && !tags.include?(@tag_to))
60+
show_not_found_message(tags)
6361
return output
6462
end
6563

@@ -115,5 +113,11 @@ def parse_change_log
115113

116114
output
117115
end
116+
117+
def show_not_found_message(tags)
118+
puts 'Could not find the given tags. Make sure that given tags exist.'
119+
puts 'Listing found tags:'
120+
puts tags
121+
end
118122
end
119123
end

0 commit comments

Comments
 (0)