]> git.ipfire.org Git - thirdparty/git.git/commit
show-branch tests: modernize test code
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Mon, 14 Jun 2021 17:18:08 +0000 (19:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 15 Jun 2021 03:12:01 +0000 (12:12 +0900)
commit9b6e74a9c0133c4e34f6ec56cc93a6a83eba2c3c
treecb4d2a6c62c77bb048a0fd2a59e43480f0ec21b8
parent4f5ce122ac05bdd24d1e0da95a7f878fabc78b20
show-branch tests: modernize test code

Modernize test code added in ce567d1867a (Add test to show that
show-branch misses out the 8th column, 2008-07-23) and
11ee57bc4c4 (sort_in_topological_order(): avoid setting a commit flag,
2008-07-23) to use test helpers.

I'm renaming "out" to "actual" for consistency with other tests, and
introducing a "branches.sorted" file in the setup, to make it clear
that it's important that the list be sorted in this particular way.

The "show-branch" output is indented with spaces, which would cause
complaints under "git show --check" with an indented here-doc
block. Let's prefix the lines with "> " to work around that, and to
make it clear that the leading whitespace is important.

We can also get rid of the hardcoding of "main" added here in
334afbc76fb (tests: mark tests relying on the current default for
`init.defaultBranch`, 2020-11-18). For this test we're setting up an
"initial" commit anyway, and now that we've moved over to test_commit
we can reference that instead.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3202-show-branch.sh