Conversation
Contributor
Code Metrics Report
Details | | main (4af4773) | #146 (946ec78) | +/- |
|---------------------|----------------|----------------|-------|
+ | Coverage | 35.2% | 35.3% | +0.1% |
| Files | 13 | 13 | 0 |
| Lines | 1079 | 1078 | -1 |
+ | Covered | 380 | 381 | +1 |
- | Code to Test Ratio | 1:2.2 | 1:2.2 | -0.1 |
| Code | 2341 | 2342 | +1 |
| Test | 5244 | 5244 | 0 |
- | Test Execution Time | 16s | 18s | +2s |Code coverage of files in pull request scope (45.7% → 46.4%)
Reported by octocov |
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.
This pull request includes several improvements focused on error handling, code clarity, and shell support. The main changes are enhanced error reporting in file operations and worktree lookups, improved resource management when copying files, and a refactor of the shell initialization logic for better maintainability and PowerShell support.
Error handling and reporting improvements:
internal/git/worktree.go: Improved error reporting inFindWorktreeByBranchOrDirby returning detailed errors when failing to get the absolute path or resolve symlinks, instead of silently returningnil.internal/git/copy_file.go,internal/git/copy_file_darwin.go: Changed the signatures ofcopyFileandcopyFileTraditionalto named return values and updated thedefer out.Close()logic to properly propagate file close errors, ensuring resource management issues are correctly reported. [1] [2] [3] [4]Shell initialization logic and support:
cmd/init.go: Refactored therunInitfunction to use common variables for shell script output, reducing code duplication. Added improved error handling for unsupported shells and unified logic for all supported shells, including explicit support for PowerShell.