-
-
Notifications
You must be signed in to change notification settings - Fork 167
fix: symlink with empty mtime #955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Deploying nfpm with
|
Latest commit: |
3fbb22a
|
Status: | ✅ Deploy successful! |
Preview URL: | https://5172e764.nfpm.pages.dev |
Branch Preview URL: | https://issue-952.nfpm.pages.dev |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #955 +/- ##
==========================================
+ Coverage 69.39% 69.41% +0.01%
==========================================
Files 22 22
Lines 3140 3142 +2
==========================================
+ Hits 2179 2181 +2
Misses 747 747
Partials 214 214 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue with symlinks that have empty modification times (mtime). The fix ensures that when a symlink's mtime is zero and the file cannot be stat'd (e.g., because it doesn't exist), the system uses the current time instead of leaving the mtime as zero.
- Modified the mtime handling logic to check both if the mtime is zero AND if the source file's mtime is non-zero
- Changed fallback behavior to use
time.Now()
instead of the passedmtime
parameter when no valid mtime is available - Added comprehensive test coverage for the symlink scenario in both files and rpm modules
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
files/files.go | Updated mtime handling logic to properly handle symlinks with non-existent targets |
files/files_test.go | Added test case to verify symlink mtime handling behavior |
rpm/rpm_test.go | Added integration test to verify RPM packaging works correctly with symlinks having empty mtime |
closes #952