Fix Windows/Git-Bash path comparison in test-sdd-workspace.sh - #2149
Open
t0domanh wants to merge 1 commit into
Open
Fix Windows/Git-Bash path comparison in test-sdd-workspace.sh#2149t0domanh wants to merge 1 commit into
t0domanh wants to merge 1 commit into
Conversation
git rev-parse --show-toplevel and cd ... && pwd can print different spellings of the same physical directory on Windows Git Bash/MSYS (Windows-style C:/Users/... vs MSYS-style /c/Users/...). The test string-compares a git rev-parse --show-toplevel result against sdd-workspace's own printed output, which is always normalized through a final cd "$dir" && pwd — so the comparison fails spuriously on Windows even though both sides name the same directory. Add a physical_path() helper that pushes repo/wt_root through the same cd ... && pwd normalization sdd-workspace's output already receives, so both sides of every comparison are guaranteed to be spelled identically regardless of platform path-style quirks. No-op on Linux/macOS, where the two forms already agree. Verified on Windows 10 + Git Bash: 5 of 13 assertions failed before this fix, all 13 pass after.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/claude-code/test-sdd-workspace.shstring-compares agit rev-parse --show-toplevelresult againstsdd-workspace's own printed output, which is always normalized through a finalcd "$dir" && pwd.git rev-parse --show-toplevelprints Windows-styleC:/Users/..., whilecd ... && pwdprints MSYS-style/c/Users/...). The string comparison then fails even though both sides name the same directory — 5 of 13 assertions failed on a Windows 10 + Git Bash machine before this fix.physical_path()helper ((cd "$1" && pwd)) and applies it to both places the test derives a comparison root fromgit rev-parse --show-toplevel(repoandwt_root), pushing them through the same normalizationsdd-workspace's printed output already goes through.git rev-parse --show-toplevelandcd ... && pwdalready agree (modulo the resolved-symlink/var→/private/varcase the existing comment already handles) —cd "$X" && pwdon an already-canonical path returns$Xunchanged.Test plan
bash tests/claude-code/test-sdd-workspace.sh— 13/13 assertions pass on Windows 10 + Git Bash after this change (5 previously failed: "prints<repo-root>/.superpowers/sdd/<plan>", "task-brief writes its brief…", "review-package writes its diff…", "linked worktree resolves its own distinct workspace", plus a related worktree assertion)