libgit2 / libgit2/pygit2

AttributeError: cffi library 'pygit2._libgit2' has no function, constant or global variable named 'git_remote_save'

Abierto
#1,219 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
Python
Estrellas
1.7k
Forks
408
Merge medio
2 d 57 min
PR fusionados (30 d)
7

Descripción

I've installed using pip install pygit2==1.12.1. The environment is a python:3.10 docker container.

I'm receiving:

Traceback (most recent call last):
  ...
  File "...", line 197, in pull_repo
    remote.save()
  File "/app/env/lib/python3.10/site-packages/pygit2/remote.py", line 117, in save
    err = C.git_remote_save(self._remote)
AttributeError: cffi library 'pygit2._libgit2' has no function, constant or global variable named 'git_remote_save'. Did you mean: 'git_remote_name'?

The relevant code associated with this error is as follows:

repo = pygit2.Repository(checkout_location)
remote = repo.remotes['origin']
remote.fetch(callbacks=callbacks)
remote.save()

I attempted to use the Remote.save method because the call to Remote.fetch didn't appear to do anything to the repository, which is known to have changed.

Note, I could be using this all wrong, but I would still think an AttributeError shouldn't be raised. Also, there isn't a good example or clear way to do the equivalent of a git pull, which is why I'm fiddling with fetching the remote in order to advance the index.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce el traceback en el contenedor python:3.10 con pygit2==1.12.1 y, después, inspecciona pygit2/remote.py alrededor de Remote.save y los bindings de libgit2 incluidos. Comprueba cómo se espera que Remote.fetch actualice el estado del repositorio y si el flujo de trabajo documentado evita este símbolo ausente; la tarea estará terminada cuando la operación indicada ya no genere AttributeError y su comportamiento esté cubierto o claramente documentado.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
git, python
Área
tooling
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
38/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.