`Repository.diff(cached=True)` does not list diffs for indexed files
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.7k
- Forks
- 408
- Avg merge
- 2d 57m
- Merged PRs (30d)
- 7
Description
This is with pygit2 version 0.24.0.
$ git init
Initialized empty Git repository in /tmp/minimal/.git/
$ touch foo
$ git add foo
$ git commit -am "First commit"
[master (root-commit) 3551222] First commit
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 foo
$ echo "foobar" >> foo
$ git add foo
$ git diff --cached
diff --git a/foo b/foo
index e69de29..323fae0 100644
--- a/foo
+++ b/foo
@@ -0,0 +1 @@
+foobar
$ python
>>> import pygit2
>>> repo = pygit2.Repository('.')
>>> list(repo.diff(cached=True))
[]
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the documented pygit2.Repository('.') and Repository.diff(cached=True) example, comparing its result with git diff --cached. Trace the cached diff entry point and related tests in pygit2, then verify that indexed-file changes are returned and match the command-line diff.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100