File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ function __FUNC___gtrconfig_path
176176 test -n "$_gtr_repo_root"; or return 1
177177 printf '%s/.gtrconfig\n' "$_gtr_repo_root"
178178 else
179- printf '%s/.gtrconfig\n' (string replace -r '/\\ .git$' '' -- "$_gtr_git_common_dir")
179+ printf '%s/.gtrconfig\n' (string replace -r '/\.git$' '' -- "$_gtr_git_common_dir")
180180 end
181181end
182182
Original file line number Diff line number Diff line change @@ -305,6 +305,21 @@ require_runtime_shell() {
305305 [[ " $output " == * ' cat "$_gtr_trust_path"' * ]]
306306}
307307
308+ @test " fish output strips linked-worktree git common dir suffix" {
309+ require_runtime_shell fish
310+
311+ run cmd_init fish
312+ [ " $status " -eq 0 ]
313+
314+ local pattern
315+ pattern=$( printf ' %s\n' " $output " | sed -n " s/.*string replace -r '\([^']*\)'.*/\1/p" | head -n 1)
316+ [ " $pattern " = ' /\.git$' ]
317+
318+ run fish -c ' string replace -r -- $argv[1] "" /tmp/repo/.git' -- " $pattern "
319+ [ " $status " -eq 0 ]
320+ [ " $output " = " /tmp/repo" ]
321+ }
322+
308323# ── new --cd wrapper support ────────────────────────────────────────────────
309324
310325@test " bash output intercepts new --cd and strips flag before delegating" {
You can’t perform that action at this time.
0 commit comments