Re: [PATCH 06/11] t3407: strengthen rebase --abort tests
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Sep 8, 2021, 10:42 UTC
- Message-ID
- <87a6knibxh.fsf@evledraar.gmail.com>
- In-Reply-To
- <87d7e9bf2d4537ddbdec8c8fa67190e81a426312.1631094563.git.gitgitgadget@gmail.com>
On Wed, Sep 08 2021, Phillip Wood via GitGitGadget wrote:
Show 10 quoted lines
> The existing tests only check that HEAD points to the correct
> commit after aborting, they do not check that the original branch
> is checked out.
> [...]
> +# Check that HEAD is equal to "pre-rebase" and the current branch is
> +# "to-rebase"
> +check_head() {
> + test_cmp_rev HEAD pre-rebase &&
> + test "$(git symbolic-ref HEAD)" = refs/heads/to-rebase
> +}I reflexively thought "use test_cmp here!", but in this case that's pointless as any difference is noted by test_cmp_rev, we're really seeing what HEAD is checked out to here. I see we use the same pattern in various other tests...