Repository navigation
Conversation
`WorkingTree::has_staged_changes` ran porcelain `git diff --cached --quiet`, which honors `submodule.<name>.ignore`. Under `= all`, a staged submodule pointer bump read as nothing staged, so `wt step commit` bailed "Nothing to commit" while its own `--dry-run` — which already renders the staged diff through plumbing — showed the bump, and `wt step squash` took the already-squashed exit and left it uncommitted. It now runs `diff-index` through `PlumbingDiff::args`, which overrides that setting, and branches on the exit code rather than reading any failure as "has changes", so a git error surfaces instead of passing for a staged change. `--ita-invisible-in-index` keeps an `add -N` path unstaged, which is the answer porcelain gave and the one the staged diff renders. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
…tdout `test_show_prompt_ignores_diff_display_config` compared `--show-prompt` stdout across three diff-display settings. Two of them change the prompt's content, so they were real; `color.ui = always` was not, because `.output()` pipes stdout and anstream strips ANSI on a pipe. Both runs produced identical bytes whether or not the diff was colored, so that third of the test could not fail — it passes against the v0.78.0 binary, which the setting did reach. Now renamed to `test_generation_prompt_ignores_diff_display_config`, it points `commit.generation.command` at a script that writes its stdin to a file, so the comparison is over the bytes wt actually hands the command, where the color survives. It asserts directly that those bytes carry no escape byte. `--dry-run` stages into a temp index, so neither run mutates what the other reads. The branch summary had no coverage at all, and its prompt reaches a command's stdin the same way, so `generate_summary` gets the same test beside it. Both fail when `PreparedDiff::capture` is put back on porcelain. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
worktrunk-bot
left a comment
Collaborator
There was a problem hiding this comment.
#4192 makes the same change to has_staged_changes — PlumbingDiff::Index plus the exit-code match — so one of the two should close as a duplicate. It also carries the error-path test noted inline below, which is worth keeping on whichever survives.
#4192 makes the same change with more coverage (git errors, nested discovery under diff.relative, intent-to-add, ignored gitlinks), so this PR keeps only the prompt-test repair. Also corrects the capture-path comment in the generation-prompt test, which described a shared command the loop doesn't use. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
worktrunk-bot
approved these changes
Sep 21, 2026
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.
test_show_prompt_ignores_diff_display_configwas meant to pin that the LLM prompt ignorescolor.ui,diff.external, anddiff.noprefix. It compared--show-promptstdout, which.output()pipes, so anstream stripped ANSI and thecolor.ui = alwayscase passed whatever the diff code did.Now
test_generation_prompt_ignores_diff_display_config, it pointscommit.generation.commandat a script that saves its stdin, and compares the bytes the LLM command actually receives forwt step commit --dry-runandwt step squash --dry-run. It asserts no escape byte directly and checks the prompt matches the default-config prompt byte for byte. The branch-summary prompt had no such test;picker/summary.rsgets the same check. WithPreparedDiff::capturereverted to porcelain, both tests fail on the escape-byte assertion.An earlier version of this PR also moved
has_staged_changesonto plumbing; #4192 makes that change with more coverage, so it's dropped here.🤖 Generated with Claude Code