Re: [PATCH] tests: fix autostash
Show 5 quoted lines
> Yes you do. The rest of the tests expect that the previous rebase has
> been aborted.
>
> In fact, all the tests depend on the previous test finishing
> correctly, which is not the way tests should be written.
How else am I supposed to write them? If there is a stale state from the previous test, there isn't too much I can do. Or should I be cleaning up state at the beginning of each test, instead of at the end?
> Doing 'rm -rf $dotest' is even worst than 'git rebase --abort',
> because it relies on the implementation of 'git rebase', which might
> need to remove more files than $dotest.
Huh? Tests aren't allowed to rely on how a command is implemented?
$ git grep test_path t
Ofcourse they're implementation details. Even in this very test, I check $dotest/autostash plenty of times.
Have you read rr/rebase-autostash? The whole idea is to inject $dotest/autostash and teach various scripts about how their assumptions about $dotest have changed.
> This wouldn't be a problem if the tests were implemented correctly,
> but they are not, so 'git rebase --abort' is the only sane option.
Then show me how to do it correctly.