libgit2 / libgit2/pygit2

`Repository.diff(cached=True)` does not list diffs for indexed files

Ouverte
#712 1 commentaire 2 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
Python
Étoiles
1.7k
Forks
408
Merge moyen
2 j 57 min
PR mergées (30 j)
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))
[]

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
git, python
Domaine
devtools
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
45/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.