-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add a ~p parameter to Patch.parse mimicking the behaviour of patch -p<num> #9
Conversation
Thanks, this looks great. I force-pushed (rebased on main now that #7 is merged), and added a commit which fixes the tests. The only question I have is about "rename_only", namely in test/git2.diff:
And here our header / parser now returns git2.old / git2.new -- without the |
I added another commit, please let me know if this works fine for you (esp. the rename case). I think this is good. |
thanks @kit-ty-kate, API-wise this looks fine to me, and is an appreciated cleanup. |
…<num> Co-authored-by: Hannes Mehnert <[email protected]>
I fixed the behaviour with adjacent slashes (per GNU patch's behaviour) and added some tests. Merging |
PR on top of #20
This is required when dealing with both git and GNU diffs. The user of the library cannot know which name was there to begin with an cannot eliminate the prefix in the filenames accordingly.
Requiring a
~p
parameter allows to give all the filenames cleanly and also to mimic the behaviour from GNU patch: