Add tempfile and improve git error handling - #38
Open
MikeGarde wants to merge 1 commit into
Open
Conversation
- Add `tempfile` as a dev-dependency in `Cargo.toml` to enable temporary file handling in tests - Update `Cargo.lock` to lock `tempfile` and its transitive dependencies for reproducible CI - Improve `src/git.rs` error handling to include git's `stderr` when present, falling back to exit status if not - Make `staged_diff_for_file` robust when run from subdirectories by anchoring the pathspec to the repo root with `:/path`; document this behavior - Extend `tests/git.rs` with a focused test for `staged_diff_for_file` and `staged_files` from a subdirectory; add helper `repo_with_staged_nested_file` to create a temp repo with a nested staged change - Update imports in tests to include `staged_diff_for_file` and `staged_files` to exercise staging-related functionality
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.
tempfileas a dev-dependency inCargo.tomlto enable temporary file handling in testsCargo.lockto locktempfileand its transitive dependencies for reproducible CIsrc/git.rserror handling to include git'sstderrwhen present, falling back to exit status if notstaged_diff_for_filerobust when run from subdirectories by anchoring the pathspec to the repo root with:/path; document this behaviortests/git.rswith a focused test forstaged_diff_for_fileandstaged_filesfrom a subdirectory; add helperrepo_with_staged_nested_fileto create a temp repo with a nested staged changestaged_diff_for_fileandstaged_filesto exercise staging-related functionality