Repository.merge_file_from_index - can't take a None as an argument
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 probably more of a libgit2 question but given that I am working on pygit2, I better start the conversation over here.
I am working on writing unit tests for Repository.merge_file_from_index. I want to add a test for a deleted file. The signature of the method provides for None as a valid argument:
def merge_file_from_index(
self,
ancestor: typing.Union[None, IndexEntry],
ours: typing.Union[None, IndexEntry],
theirs: typing.Union[None, IndexEntry],
) -> str:
So I have this:
def test_merge_file_from_index(testrepo):
hello_txt = testrepo.index["hello.txt"]
# deleting the file on theirs
res = testrepo.merge_file_from_index(hello_txt, hello_txt, None)
assert res == ""
And I am getting this when I run the test:
> raise GitError(message)
E _pygit2.GitError: invalid argument: 'theirs'
Am I wrong in my understanding from the signature that None is a correct value?
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Lisez pygit2/repository.py autour de la ligne 682 et exécutez le test présenté pour Repository.merge_file_from_index. Vérifiez si l’implémentation accepte None pour l’argument theirs, comme l’indique la signature ; le travail est terminé lorsque le comportement et le test concordent dans le cas d’un fichier supprimé.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- git, python
- Domaine
- tooling
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 38/100