]> Kevux Git Server - rit/commit
t2000: modernise overall structure
authorZakariyah Ali <zakariyahali100@gmail.com>
Fri, 27 Mar 2026 23:40:19 +0000 (00:40 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 28 Mar 2026 18:26:13 +0000 (11:26 -0700)
commitd8e34f971b31ae6583e796626c7280732fca68e1
tree788071485d04bbbb33487fa689a7dc5fc4de33ae
parent67ad42147a7acc2af6074753ebd03d904476118f
t2000: modernise overall structure

This test script that dates back to 2005 certainly shows its age and
both its style and the way the tests are laid out do not match the
modern standard.

 * Executables that prepare the data used to test the command should
   be inside the test_expect_success block in modern tests.

 * In modern tests, running a command that is being tested, making
   sure it succeeds, and inspecting other side effects that are
   expected, are all done in a single test_expect_success block.

 * A test_expect_success block in modern tests are laid out as

        test_expect_success 'title of the test' '
                body of the test &&
                ...
                body of the test
        '

   not as

        test_expect_success \
                'title of the test' \
                'body of the test &&
                ...
                body of the test'

   which is in a prehistoric style.

 * In modern tests, each &&-chained statement in the body of the
   test_expect_success block are indented with a horizontal tab,
   unlike prehistoric style that used 4-space indent.

Signed-off-by: Zakariyah Ali <zakariyahali100@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t2000-conflict-when-checking-files-out.sh