Re: [PATCH v4 3/3] worktree add: Add hint to use --orphan when bad ref
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Dec 12, 2022, 18:35 UTC
- Message-ID
- <CAPig+cQP4mBFaLX+DtAWHR59WM3vQM+ZHrLkLeZrsxosVwkdTQ@mail.gmail.com>
- In-Reply-To
- <221212.86zgbs4h9f.gmgdl@evledraar.gmail.com>
On Mon, Dec 12, 2022 at 1:19 PM Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
Show 9 quoted lines
> On Mon, Dec 12 2022, Jacob Abel wrote: > > Also, Is there an easier way to debug the `test_expect_success` statements? I > > tried enabling tracing mode but it doesn't seem to trace into those statements. > > Not really, other than just enabling "-x" for the test-lib.sh itself, i.e.: > > sh -x ./t0001-init.sh > > I *think* that should work, but I didn't test it...
Isn't the question here how to debug the body of a test_expect_success? If that's the case, then running the test with -x and -i should help:
./t001-init.sh -x -i
The -x makes it print all the output as it's executing the body of the test_expect_success rather than suppressing it, and -i makes it stop as soon as it encounters a failing test, which makes it easier to examine the state of that test. After the script aborts (via -i), look inside the "trash*" directory. Also, you can insert calls to test_pause in the body of a test, which will make it drop into an interactive shell session in the trash directory at the point of the test_pause, so you can examine the state of the test directly as it exists at that point (as opposed to examining it after the test failed, as with -i).