Re: [PATCH] checkout: add --autostash option for branch switching
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Apr 15, 2026, 09:34 UTC
- Message-ID
- <538fc297-d09c-43c1-8240-d1680fbec4cb@gmail.com>
- In-Reply-To
- <20260414200827.51072-1-haraldnordgren@gmail.com>
On 14/04/2026 21:08, Harald Nordgren wrote:
Show 12 quoted lines
>>> +test_expect_success 'apply with custom conflict labels' ' >>> + git init conflict_labels && >>> + ( >> >> I'm still unclear why we're creating a new repository here. Our test >> suite is slow enough already without each test spending time creating >> its own repository. There doesn't seem to be anything here that requires >> isolating the test in this way. > > Yes, I want this too, but I had some problems to get it to work. Found a > way now I think, but the cleanup is not 100% trivial (this is the only > reason to run anything inside a new repo).
Normally the first test would setup some commits with test_commit() that creates a tag so you can just use "git reset --hard <tag>" to start your test from a known state. Unfortunately setup_stash() does not use test_commit() so there are no tags. It would be useful to fix that by adding a line that creates a tag so that future test authors do not face the same problem.
Thanks
Phillip