Skip to content
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

patch-commit doesn't work as expected when change a file which has no newline at end of line #5320

Closed
await-ovo opened this issue Sep 8, 2022 · 0 comments · Fixed by #5321
Milestone

Comments

@await-ovo
Copy link
Member

pnpm version:

$ pnpm -v
7.11.0

Code to reproduce the issue:

  1. run pnpm patch safe-execa@0.1.2
  2. append some text to lib/index.js in given temp directory like following:
    image
  3. run pnpm patch-commit <temp dir>
  4. you can see that node_modules/safe-execa/lib/index.js become as follows:
    image

Expected behavior:

All changes should be synced to node_modules/safe-execa when the commit is executed.

Actual behavior:

Last line of editing is missing.

Additional information:

As far as i know, When the modified file does not have EOL , git diff ends with \ No newline at end of file. I tried ignore it , and patch-commit works fine. I'm not sure if it's more appropriate to handle this situation during the installation process, thanks a lot~

  • node -v prints: v16.15.1
  • Windows, macOS, or Linux?: macOS 11.6.8
zkochan pushed a commit that referenced this issue Sep 15, 2022
close #5320
Co-authored-by: Zoltan Kochan <z@kochan.io>
@zkochan zkochan added this to the v7.12 milestone Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants