@matheusbsbs / matheus-bagliano / commits / d88593fa04
Fork 0

t4126: fix test that happened to work due to timing

The test did "reset --hard" (where the HEAD commit has an empty blob at path "empty") followed by "> empty", expecting that the index does not notice the file _changed_ since git wrote it out upon "reset" if the redirection is done quickly enough. There was no need to do the emptying, and it gave a wrong result if "reset --hard" happened on time T and then ">empty" happened on the next second T+1. This fixes it. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jun 13, 2008 at 17:16 UTC d88593fa0412a4f0a363860d879e97635c118616
1 file changed -4
t/t4126-apply-empty.sh
-4
@@ -26,7 +26,6 @@ test_expect_success setup '
26
27 test_expect_success 'apply empty' '
28 git reset --hard &&
29 - >empty &&
29 rm -f missing &&
30 git apply patch0 &&
31 test_cmp expect empty
@@ -34,7 +33,6 @@ test_expect_success 'apply empty' '
33
34 test_expect_success 'apply --index empty' '
35 git reset --hard &&
37 - >empty &&
36 rm -f missing &&
37 git apply --index patch0 &&
38 test_cmp expect empty &&
@@ -43,7 +41,6 @@ test_expect_success 'apply --index empty' '
41
42 test_expect_success 'apply create' '
43 git reset --hard &&
46 - >empty &&
44 rm -f missing &&
45 git apply patch1 &&
46 test_cmp expect missing
@@ -51,7 +48,6 @@ test_expect_success 'apply create' '
48
49 test_expect_success 'apply --index create' '
50 git reset --hard &&
54 - >empty &&
51 rm -f missing &&
52 git apply --index patch1 &&
53 test_cmp expect missing &&