Before the change, test_expect_equal_file moved files it compared
in case of failure.  The patch changes it to copy the files
instead.  This allows testing non-temporary files which are
stored in git.

Note: the change should not result in new temporary files left
after the tests.  Test_expect_equal_file used to move files only
on failure, so callers had to cleanup them anyway.
 test/ |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/ b/test/
index eaf5051..7cc43cd 100755
--- a/test/
+++ b/test/
@@ -477,8 +477,8 @@ test_expect_equal_file ()
                        test_ok_ "$test_subtest_name"
-                       mv "$output" $testname.output
-                       mv "$expected" $testname.expected
+                       cp "$output" $testname.output
+                       cp "$expected" $testname.expected
                        test_failure_ "$test_subtest_name" "$(diff -u 
$testname.expected $testname.output)"

Reply via email to