Repository navigation
Report inputs that share an output name, and reject --output equal to --input [patch] - #138
Merged
Merged
Conversation
… --input [patch] Every output is <base name>.png, so save.png and save.bmp wrote the same file: the later one won while the summary counted both. ProcessDirectory now remembers the names it has written in a run and counts a collision as a failed file. Validate rejects an output directory that is the input directory, which used to replace the source icons with their masks and exit 0. Fixes #120 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WyG38ppCkkDDCmkSnea826
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WyG38ppCkkDDCmkSnea826
|
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.



Fixes #120
What changed
ProcessDirectorynow remembers which output names it has written during a run. If a later input maps to a name that is already taken, for examplesave.bmpaftersave.png, that input is reported as failed with a message naming the earlier input, and it is not written. The first input's output is kept, the written count matches the files on disk, and the run exits2.--outputequal to--input.Arguments.Validaterejects an output directory that resolves to the input directory, trailing separator included, so the run exits1before any source icon is overwritten.Arguments.PathComparisonmakes both checks case-insensitive on Windows and macOS and case-sensitive elsewhere, to match the default file systems.Tests
ProcessDirectoryTests.InputsSharingABaseNameDoNotOverwriteEachOther:save.png+save.bmpgives 1 written, 1 failed, one file on disk, and exit code 2.ArgumentsTests.ValidateRejectsAnOutputThatIsTheInputDirectory: setting--outputto the input path with a trailing separator is rejected.With the fix reverted, both new tests fail. With the fix in place, every test passes except the 8
OutputMatchesTheGoldMastercases, which fail locally because the Git LFS fixtures are pointer stubs in this checkout. CLAUDE.md documents that case, and it is unrelated to this change.dotnet build --no-incremental -warnaserroris clean.This branch is independent of #137, which touches the same loop for #119. Whichever of the two merges second may need a small rebase.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WyG38ppCkkDDCmkSnea826
Generated by Claude Code