From 7de94a1b21bbbc792ef0ed68271df1c752e80d19 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 9 Oct 2026 12:55:06 +0200 Subject: [PATCH] test: guard against empty command lists in the git manual At some stage, the command lists at `/docs/git` were empty because the generator assumed `.txt` even for Git versions using `.adoc` (one of the many, many regressions caused by that ill-executed upstream change). https://github.com/git/git-scm.com/pull/2014 fixed that mismatch. Add regression coverage for all twelve lists so incidental links cannot mask a recurrence, as I had suggested in https://github.com/git/git-scm.com/issues/2021#issuecomment-3028463475. Assisted-by: GPT-6.1 Sol Signed-off-by: Johannes Schindelin --- README.md | 1 + tests/git-scm.spec.js | 27 +++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/README.md b/README.md index 7143e876f5..5dc1c82b60 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,7 @@ Believe it or not, https://git-scm.com/ has its own test suite. It uses [Playwri > /external/book/content/book/en/v2/_index.html \ > /external/book/content/book/fr/v2/Démarrage-rapide-À-propos-de-la-gestion-de-version.html \ > /external/book/data/ \ +> /external/docs/content/docs/git.html \ > /external/docs/content/docs/git-add/fr.html \ > /external/docs/content/docs/git-clone.html \ > /external/docs/content/docs/git-commit.html \ diff --git a/tests/git-scm.spec.js b/tests/git-scm.spec.js index ef55128728..a195d17f75 100644 --- a/tests/git-scm.spec.js +++ b/tests/git-scm.spec.js @@ -195,6 +195,33 @@ test('manual pages', async ({ page }) => { await expect(synopsis).not.toHaveText(/git remote renom.* /) }) +test('git manual lists commands', async ({ page }) => { + await page.goto(`${url}docs/git`) + + for (const [section, command] of [ + ['main_porcelain_commands', 'git-add[1]'], + ['ancillary_commands', 'git-config[1]'], + ['ancillary_commands', 'git-annotate[1]'], + ['interacting_with_others', 'git-archimport[1]'], + ['manipulation_commands', 'git-apply[1]'], + ['interrogation_commands', 'git-cat-file[1]'], + ['syncing_repositories', 'git-daemon[1]'], + ['syncing_repositories', 'git-http-fetch[1]'], + ['internal_helper_commands', 'git-check-attr[1]'], + ['guides', 'gitcore-tutorial[7]'], + ['repository_command_and_file_interfaces', 'gitattributes[5]'], + [ + 'file_formats_protocols_and_other_developer_interfaces', + 'gitformat-bundle[5]' + ] + ]) { + const commands = page.locator(`#_${section}`) + .locator('xpath=..').locator('dt') + await expect(commands.getByRole('link', { name: command, exact: true })) + .toBeVisible() + } +}) + test('anchor links in manual pages', async ({ page }) => { // Test that anchor links work without HTML tags const anchor = '#Documentation/git-clone.txt---recurse-submodulesltpathspecgt'