This repository was archived by the owner on Dec 6, 2020. It is now read-only.
File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 20
20
# https://github.com/l0b0/diff-ignore-moved-lines/issues
21
21
#
22
22
# COPYRIGHT
23
- # Copyright (C) 2011-2012 Victor Engmark
23
+ # Copyright (C) 2011-2014 Victor Engmark
24
24
#
25
25
# This program is free software: you can redistribute it and/or modify
26
26
# it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ set -o errexit -o noclobber -o nounset -o pipefail
41
41
42
42
# Only output diff lines (context lines and such would not be accurate anyway)
43
43
# Also, convert unified diffs to "normal" diffs
44
- diff_lines=" $( grep ' ^ [><+-] ' | sed ' s/^+/>/;s/^-/</' ) " || exit 0
44
+ diff_lines=" $( grep -v ' ^\(---\|+++\|@@ \) ' | grep ' ^\( [><] \)\|[ +-]' | sed ' s/^+/> /;s/^-/< /' ) " || exit 0
45
45
46
46
while IFS= read -r line || [ -n " $line " ]
47
47
do
Original file line number Diff line number Diff line change 91
91
" Moved and changed lines" \
92
92
" $diff " x \
93
93
" $( diff <( printf %s " $file1 " ) <( printf %s " $file2 " ) | " $cmd " || printf x) "
94
+
95
+ assertEquals \
96
+ " Moved and changed lines (unified)" \
97
+ " $diff " x \
98
+ " $( diff -u <( printf %s " $file1 " ) <( printf %s " $file2 " ) | " $cmd " || printf x) "
94
99
}
95
100
96
101
# load and run shUnit2
97
102
test -n " ${ZSH_VERSION:- } " && SHUNIT_PARENT=$0
98
- . /usr/share/shunit2/ shunit2
103
+ . shunit2
You can’t perform that action at this time.
0 commit comments