Skip to content

how to diff one file in working dir against a Blob? #604

Open
@barry-scott

Description

@barry-scott

pygit2 version python3-pygit2-0.23.3-2.fc23.x86_64

I cannot figure out how I can get a diff for only one file.

How do I arrange to have pygit2 return the diff of a Blob against the working dir file?

I looked at calling diff_to_working on a new Index(), but that fails because the new Index() does not
self._repo filled in.

TreeBuilder() seems is unable to help as it requires putting tree objects into the repo to allow
for the folder structure, for example to diff Source/file.py. needs a tree for Source. I clearly
do not want to be writting files into the repo to do a diff.

Did I miss something in API?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions