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

Unable to handle file paths from "git diff --cached" #27

Open
rohanpm opened this issue Aug 2, 2016 · 1 comment
Open

Unable to handle file paths from "git diff --cached" #27

rohanpm opened this issue Aug 2, 2016 · 1 comment

Comments

@rohanpm
Copy link

rohanpm commented Aug 2, 2016

"git diff --cached" produces file headers such as:

diff --git c/README.md i/README.md
index cfe07c3..6d38cfe 100644
--- c/README.md
+++ i/README.md

unidiff incorrectly considers this as a change to file "c/README.md" instead of a change to "README.md".

It looks like the reason is that

def path(self):
has hardcoded expectations about a/ and b/ prefixes only.

@rohanpm
Copy link
Author

rohanpm commented Aug 23, 2016

Actually, "git diff --cached" only behaves that way if diff.mnemonicprefix config item is set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant