Skip to content

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

Open

Description

@rohanpm

"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.

Activity

  1. rohanpm commented on Aug 23, 2016

    @rohanpm
    Author

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

  2. danwald commented on Jul 19, 2026

    @danwald

    Looks like it was merged into main .. need a relase >0.7.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions