summaryrefslogtreecommitdiff
path: root/t/t0012-help.sh
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-02-21 19:38:52 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-23 21:41:37 (GMT)
commit93de1b6999898079f521afd73d6a4ae9d5f9aaea (patch)
tree81e630084795ec713163b5318fa5f5159e4f911b /t/t0012-help.sh
parent1ce590133b545aa735683f46003d12df624d67af (diff)
downloadgit-93de1b6999898079f521afd73d6a4ae9d5f9aaea.zip
git-93de1b6999898079f521afd73d6a4ae9d5f9aaea.tar.gz
git-93de1b6999898079f521afd73d6a4ae9d5f9aaea.tar.bz2
help: don't print "\n" before single-section output
Fix a formatting regression in 1b81d8cb19d (help: use command-list.txt for the source of guides, 2018-05-20). Adjust the output of "git help --guides" and any other future single-section commands so that a newline isn't inserted before the only section being printed. This changes the output from: $ git help --guides The Git concept guides are: [...] To: $ git help --guides The Git concept guides are: [...] That we started printing an extra "\n" in 1b81d8cb19d wasn't intended, but an emergent effect of moving all of the printing of "git help" output to code that was ready to handle printing N sections. With 1b81d8cb19d we started using the "print_cmd_by_category()" function added earlier in the same series, or in cfb22a02ab5 (help: use command-list.h for common command list, 2018-05-10). Fixing this formatting nit is easy enough. Let's have all of the output that would like to be "\n"-separated from other lines emit its own "\n". We then adjust "print_cmd_by_category()" to only print a "\n" to delimit the sections it's printing out. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0012-help.sh')
-rwxr-xr-xt/t0012-help.sh1
1 files changed, 0 insertions, 1 deletions
diff --git a/t/t0012-help.sh b/t/t0012-help.sh
index 6432148..6c3e1f7 100755
--- a/t/t0012-help.sh
+++ b/t/t0012-help.sh
@@ -226,7 +226,6 @@ test_expect_success "'git help -a' section spacing" '
test_expect_success "'git help -g' section spacing" '
test_section_spacing_trailer git help -g <<-\EOF &&
-
The Git concept guides are:
EOF