[PATCH] t1900: cover repo info path keys in non-default layouts Extend the path-key coverage in t1900 to exercise layouts where the reported paths differ from a regular worktree.
Add comparisons against rev-parse for path.git-dir, path.common-dir, and path.toplevel in a linked worktree and a repository created with --separate-git-dir. Also cover path.git-dir with --path-format=relative in the separate-git-dir case, and path.superproject-working-tree with --path-format=relative in a submodule.
Signed-off-by: Jialong Wang <jerrywang183@yahoo.com>
---
t/t1900-repo.sh | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+) diff --git a/t/t1900-repo.sh b/t/t1900-repo.sh
index 6605394d1f..3f39d2b9f6 100755
--- a/t/t1900-repo.sh
+++ b/t/t1900-repo.sh
@@ -241,6 +241,60 @@ test_expect_success 'path.superproject-working-tree matches rev-parse in submodu
test_cmp expect actual
'
+test_expect_success 'path keys match rev-parse in linked worktree' '
+ git init path-linked-main &&
+ echo x >path-linked-main/x &&
+ git -C path-linked-main add x &&
+ git -C path-linked-main commit -m x &&
+ git -C path-linked-main worktree add ../path-linked-worktree &&
+
+ expected_value=$(git -C path-linked-worktree rev-parse --absolute-git-dir) &&
+ echo "path.git-dir=$expected_value" >expect &&
+ git -C path-linked-worktree repo info path.git-dir >actual &&
+ test_cmp expect actual &&
+
+ expected_value=$(git -C path-linked-worktree rev-parse --path-format=absolute --git-common-dir) &&
+ echo "path.common-dir=$expected_value" >expect &&
+ git -C path-linked-worktree repo info path.common-dir >actual &&
+ test_cmp expect actual &&
+
+ expected_value=$(git -C path-linked-worktree rev-parse --show-toplevel) &&
+ echo "path.toplevel=$expected_value" >expect &&
+ git -C path-linked-worktree repo info path.toplevel >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'path keys match rev-parse with --separate-git-dir' '
+ git init --separate-git-dir path-separate.git path-separate-worktree &&
+
+ expected_value=$(git -C path-separate-worktree rev-parse --absolute-git-dir) &&
+ echo "path.git-dir=$expected_value" >expect &&
+ git -C path-separate-worktree repo info path.git-dir >actual &&
+ test_cmp expect actual &&
+
+ expected_value=$(git -C path-separate-worktree rev-parse --path-format=absolute --git-common-dir) &&
+ echo "path.common-dir=$expected_value" >expect &&
+ git -C path-separate-worktree repo info path.common-dir >actual &&
+ test_cmp expect actual &&
+
+ expected_value=$(git -C path-separate-worktree rev-parse --show-toplevel) &&
+ echo "path.toplevel=$expected_value" >expect &&
+ git -C path-separate-worktree repo info path.toplevel >actual &&
+ test_cmp expect actual &&
+
+ expected_value=$(git -C path-separate-worktree rev-parse --path-format=relative --git-dir) &&
+ echo "path.git-dir=$expected_value" >expect &&
+ git -C path-separate-worktree repo info --path-format=relative path.git-dir >actual &&
+ test_cmp expect actual
+'
+
+test_expect_success 'relative path.superproject-working-tree matches rev-parse in submodule' '
+ expected_value=$(git -C path-superproject-parent/sm rev-parse --path-format=relative --show-superproject-working-tree) &&
+ echo "path.superproject-working-tree=$expected_value" >expect &&
+ git -C path-superproject-parent/sm repo info --path-format=relative path.superproject-working-tree >actual &&
+ test_cmp expect actual
+'
+
test_expect_success 'path category returns all path keys' '
git init path-category &&
>expect &&
--
2.51.0 Message 66 of 68 in “repo: extend info path reporting and structure statistics” 0/3 repo: extend info path reporting and structure statisticseslam reda via GitGitGadget, Feb 22, 2026 1/3 repo: extend info paths and structure statisticseslam-reda-div via GitGitGadget, Feb 22, 2026 2/3 t1900,t1901: make repo tests hash-agnostic and wc-portableEslam reda ragheb via GitGitGadget, Feb 22, 2026 3/3 t1900,t1901: fix test portability issuesEslam reda ragheb via GitGitGadget, Feb 22, 2026 Lucas Seiki Oshiro Feb 22, 2026 Lucas Seiki Oshiro Feb 22, 2026 Junio C Hamano Feb 22, 2026 Justin Tobler Feb 23, 2026 0/9 repo: extend info path reporting and structure statisticseslam reda via GitGitGadget, Feb 23, 2026 1/9 repo: teach info context and category keysEslam reda ragheb via GitGitGadget, Feb 23, 2026 2/9 repo: add path keys to repo infoEslam reda ragheb via GitGitGadget, Feb 23, 2026 4/9 repo: add structure max object size metricsEslam reda ragheb via GitGitGadget, Feb 23, 2026 5/9 repo: add structure topology and path-depth metricsEslam reda ragheb via GitGitGadget, Feb 23, 2026 6/9 repo: add aggregate structure totals to keyvalue outputEslam reda ragheb via GitGitGadget, Feb 23, 2026 7/9 t1900: cover repo info path keys and path-formatEslam reda ragheb via GitGitGadget, Feb 23, 2026 8/9 t1901: extend structure metric coverage and portabilityEslam reda ragheb via GitGitGadget, Feb 23, 2026 9/9 docs: describe repo info path keys and structure metricsEslam reda ragheb via GitGitGadget, Feb 23, 2026 0/5 repo: extend info path reporting and structure statisticseslam reda via GitGitGadget, Feb 23, 2026 1/5 repo: teach info context and category keysEslam reda ragheb via GitGitGadget, Feb 23, 2026 2/5 repo: add path keys to repo infoEslam reda ragheb via GitGitGadget, Feb 23, 2026 3/5 repo: add --path-format for info path outputEslam reda ragheb via GitGitGadget, Feb 23, 2026 4/5 t1900: cover repo info path keys and path-formatEslam reda ragheb via GitGitGadget, Feb 23, 2026 5/5 docs: describe repo info path keysEslam reda ragheb via GitGitGadget, Feb 23, 2026 00/10 repo info: add category/path keys and --path-formateslam reda via GitGitGadget, Feb 26, 2026 01/10 repo: teach info context and category keysEslam reda ragheb via GitGitGadget, Feb 26, 2026 02/10 repo: add path keys to repo infoEslam reda ragheb via GitGitGadget, Feb 26, 2026 03/10 repo: add --path-format for info path outputEslam reda ragheb via GitGitGadget, Feb 26, 2026 04/10 repo: add structure max object size metricsEslam reda ragheb via GitGitGadget, Feb 26, 2026 05/10 repo: add structure topology and path-depth metricsEslam reda ragheb via GitGitGadget, Feb 26, 2026 06/10 repo: add aggregate structure totals to keyvalue outputEslam reda ragheb via GitGitGadget, Feb 26, 2026 07/10 t1900: cover repo info path keys and path-formatEslam reda ragheb via GitGitGadget, Feb 26, 2026 08/10 t1901: extend structure metric coverage and portabilityEslam reda ragheb via GitGitGadget, Feb 26, 2026 09/10 docs: describe repo info path keys and structure metricsEslam reda ragheb via GitGitGadget, Feb 26, 2026 10/10 repo: reduce repetition in structure keyvalue outputEslam reda ragheb via GitGitGadget, Feb 26, 2026 Junio C Hamano Feb 26, 2026 Junio C Hamano Feb 26, 2026 Phillip Wood Feb 27, 2026 00/11 repo info: add category/path keys and --path-formateslam reda via GitGitGadget, Feb 27, 2026 01/11 repo: teach info context and category keysEslam reda ragheb via GitGitGadget, Feb 27, 2026 02/11 repo: add path keys to repo infoEslam reda ragheb via GitGitGadget, Feb 27, 2026 03/11 repo: add --path-format for info path outputEslam reda ragheb via GitGitGadget, Feb 27, 2026 04/11 repo: add structure max object size metricsEslam reda ragheb via GitGitGadget, Feb 27, 2026 05/11 repo: add structure topology and path-depth metricsEslam reda ragheb via GitGitGadget, Feb 27, 2026 06/11 repo: add aggregate structure totals to keyvalue outputEslam reda ragheb via GitGitGadget, Feb 27, 2026 07/11 t1900: cover repo info path keys and path-formatEslam reda ragheb via GitGitGadget, Feb 27, 2026 08/11 t1901: extend structure metric coverage and portabilityEslam reda ragheb via GitGitGadget, Feb 27, 2026 09/11 docs: describe repo info path keys and structure metricsEslam reda ragheb via GitGitGadget, Feb 27, 2026 10/11 repo: reduce repetition in structure keyvalue outputEslam reda ragheb via GitGitGadget, Feb 27, 2026 11/11 repo: refine path keys for repo infoEslam reda ragheb via GitGitGadget, Feb 27, 2026 Junio C Hamano Feb 27, 2026 Lucas Seiki Oshiro Feb 27, 2026 Lucas Seiki Oshiro Feb 27, 2026 Phillip Wood Mar 1, 2026 Phillip Wood Mar 1, 2026 0/6 repo info: add category/path keys and --path-formateslam reda via GitGitGadget, Mar 2, 2026 1/6 repo: introduce repo_info context plumbingEslam reda ragheb via GitGitGadget, Mar 2, 2026 2/6 repo: support category requests in repo infoEslam reda ragheb via GitGitGadget, Mar 2, 2026 3/6 repo: add path keys to repo infoEslam reda ragheb via GitGitGadget, Mar 2, 2026 4/6 repo: add --path-format for info path outputEslam reda ragheb via GitGitGadget, Mar 2, 2026 5/6 t1900: cover repo info path keys and path-formatEslam reda ragheb via GitGitGadget, Mar 2, 2026 6/6 docs: describe repo info path keysEslam reda ragheb via GitGitGadget, Mar 2, 2026 Junio C Hamano Mar 2, 2026 Jialong Wang Mar 18, 2026 K Jayatheerth Mar 19, 2026 Jerry Wang Mar 19, 2026 t1900: cover repo info path keys in non-default layouts Jialong Wang, Mar 19, 2026 Jialong Wang Mar 19, 2026 K Jayatheerth Mar 20, 2026 Read the whole thread , see it on lore , or plain text .