Skip to content

Commit 03ee1be

Browse files
author
Kevin Paulisse
committed
Use diffy for single line string diffs too
1 parent 8f6bcfb commit 03ee1be

File tree

1 file changed

+3
-3
lines changed
  • lib/octocatalog-diff/catalog-diff/display

1 file changed

+3
-3
lines changed

lib/octocatalog-diff/catalog-diff/display/text.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,9 @@ def self.hash_diff(obj, depth, key_in, nested = false)
319319
if nested && obj[:old].is_a?(Hash) && obj[:new].is_a?(Hash)
320320
# Nested hashes will be stringified and then use 'diffy'
321321
result.concat diff_two_hashes_with_diffy(depth: depth, hash1: obj[:old], hash2: obj[:new])
322-
elsif obj[:old].is_a?(String) && obj[:new].is_a?(String) && (obj[:old] =~ /\n/ || obj[:new] =~ /\n/)
323-
# Multi-line strings will be split and then use 'diffy' to mimic the
324-
# output seen when using "diff" on the command line
322+
elsif obj[:old].is_a?(String) && obj[:new].is_a?(String)
323+
# Strings will use 'diffy' to mimic the output seen when using
324+
# "diff" on the command line.
325325
result.concat diff_two_strings_with_diffy(obj[:old], obj[:new], depth)
326326
else
327327
# Stuff we don't recognize will be converted to a string and printed

0 commit comments

Comments
 (0)