Skip to content

Fix CopyTo same filepath truncate the file #24

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

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

alessio-perugini
Copy link
Contributor

Issue

When trying to copy the same file from src to dst the CopyTo functions truncate
the dst file.

Example:
src=dst=/tmp/a

/tmp/a -> content: "hello"
src.CopyTo(dst)
/tmp/a -> content: ""

New behaviour

Copying an existing file to the same directory throws an error.

@alessio-perugini alessio-perugini self-assigned this Sep 15, 2023
@alessio-perugini alessio-perugini added the type: bug Perceived defect in any part of project label Sep 15, 2023
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.43% 🎉

Comparison is base (7d88805) 71.95% compared to head (38b01d1) 72.39%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #24      +/-   ##
==========================================
+ Coverage   71.95%   72.39%   +0.43%     
==========================================
  Files           6        6              
  Lines         353      355       +2     
==========================================
+ Hits          254      257       +3     
+ Misses         67       66       -1     
  Partials       32       32              
Flag Coverage Δ
unit 72.39% <100.00%> (+0.43%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
paths.go 64.08% <100.00%> (+0.95%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alessio-perugini alessio-perugini merged commit 225b25c into master Sep 21, 2023
@alessio-perugini alessio-perugini deleted the fix-copy-to-bug branch September 21, 2023 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants