Skip to content

Add tempfile and improve git error handling - #38

Open
MikeGarde wants to merge 1 commit into
mainfrom
fix/37-pr-git-error
Open

Add tempfile and improve git error handling#38
MikeGarde wants to merge 1 commit into
mainfrom
fix/37-pr-git-error

Conversation

@MikeGarde

Copy link
Copy Markdown
Owner
  • 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

- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant