pygit2
pygit2 copied to clipboard
`Repository.diff(cached=True)` does not list diffs for indexed files
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))
[]