t6026-merge-attr: clean up background process at end of test case
authorJohannes Sixt <j6t@kdbg.org>
Wed, 7 Sep 2016 06:10:41 +0000 (08:10 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 7 Sep 2016 18:40:22 +0000 (11:40 -0700)
The process spawned in the hook uses the test's trash directory as CWD.
As long as it is alive, the directory cannot be removed on Windows.
Although the test succeeds, the 'test_done' that follows produces an
error message and leaves the trash directory around. Kill the process
before the test case advances.

Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t6026-merge-attr.sh

index dd8f88d..7a6e33e 100755 (executable)
@@ -185,7 +185,9 @@ test_expect_success 'custom merge does not lock index' '
        git reset --hard anchor &&
        write_script sleep-one-second.sh <<-\EOF &&
                sleep 1 &
+               echo $! >sleep.pid
        EOF
+       test_when_finished "kill \$(cat sleep.pid)" &&
 
        test_write_lines >.gitattributes \
                "* merge=ours" "text merge=sleep-one-second" &&