libgit2 / libgit2/pygit2

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

Offen
#1,219 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
Python
Sterne
1.7k
Forks
408
Ø Merge
2 T. 57 Min.
Gemergte PRs (30 T.)
7

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere den Traceback im Container python:3.10 mit pygit2==1.12.1 und untersuche anschließend pygit2/remote.py im Umfeld von Remote.save sowie die mitgelieferten libgit2-Bindings. Prüfe, wie Remote.fetch den Repository-Zustand erwartungsgemäß aktualisieren soll und ob der dokumentierte Workflow dieses fehlende Symbol vermeidet; abgeschlossen ist die Aufgabe, wenn der gemeldete Vorgang keine AttributeError mehr auslöst und sein Verhalten abgedeckt oder eindeutig dokumentiert ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
git, python
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.