t0021: keep filter log files on comparison
[gitweb.git] / t / t0021-conversion.sh
index 161f5604464d2f963e60af54eedea3f91be041fa..ff2424225b64b9fa584f5d9c03e92040c487a918 100755 (executable)
@@ -42,10 +42,10 @@ test_cmp_count () {
        for FILE in "$expect" "$actual"
        do
                sort "$FILE" | uniq -c |
-               sed -e "s/^ *[0-9][0-9]*[       ]*IN: /x IN: /" >"$FILE.tmp" &&
-               mv "$FILE.tmp" "$FILE" || return
+               sed -e "s/^ *[0-9][0-9]*[       ]*IN: /x IN: /" >"$FILE.tmp"
        done &&
-       test_cmp "$expect" "$actual"
+       test_cmp "$expect.tmp" "$actual.tmp" &&
+       rm "$expect.tmp" "$actual.tmp"
 }
 
 # Compare two files but exclude all `clean` invocations because Git can
@@ -56,10 +56,10 @@ test_cmp_exclude_clean () {
        actual=$2
        for FILE in "$expect" "$actual"
        do
-               grep -v "IN: clean" "$FILE" >"$FILE.tmp" &&
-               mv "$FILE.tmp" "$FILE"
+               grep -v "IN: clean" "$FILE" >"$FILE.tmp"
        done &&
-       test_cmp "$expect" "$actual"
+       test_cmp "$expect.tmp" "$actual.tmp" &&
+       rm "$expect.tmp" "$actual.tmp"
 }
 
 # Check that the contents of two files are equal and that their rot13 version