Thread (1 message) 1 message, 1 author, 2019-03-05

Re: [GSoC][PATCH v3 2/3] t3600: modernize style

From: Junio C Hamano <hidden>
Date: 2019-03-05 12:44:48

Eric Sunshine [off-list ref] writes:
This test is unusual in that it first cd's into a subdirectory and
then cd's back out with "cd ..". And, while the use of subshells is
correct to ensure that all 'cd' commands are undone at the end of the
test (whether successful or not), the entire construction is
unnecessarily confusing. This is not the sort of issue which should be
fixed in this style-fix patch, however, it is something which could be
cleaned up with a follow-up patch. For instance, the test might be
reworked like this:

    git init repo &&
    (
        cd repo &&
        echo something >somefile &&
        git add somefile &&
        git commit -m "add a file"
    ) &&
    git --git-dir=repo/.git --work-tree=repo rm somefile &&
    test_must_fail git -C repo ls-files --error-unmatch somefile

It's up to you whether you actually want to include such a follow-up
patch in your series; it's certainly not a requirement.
I missed that.  As you said, it can be left for further clean-up.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help