update_submodules duplicates
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'm trying to replicate git clone --recursive in pygit2, and this is the function I've come up with.
def get_submodules(repo, creds):
submodules = repo.listall_submodules()
repo.init_submodules(submodules=submodules)
repo.update_submodules(submodules=submodules, callbacks=creds)
for submodule_path in submodules:
submodule = repo.lookup_submodule(submodule_path)
sub_repo = submodule.open()
get_submodules(sub_repo, creds)
The problem I'm having is that in certain circumstances, this will cause crashes. Let me paint the picture.
Master Repo
- Submodule A
- Submodule B
2.1 Submodule A
2.2 Submodule D - Submodule C
When update_submodules attempts to run on Submodule A the second time, it crashes. Not completely sure how to get around this. Some repos are in this format, but I haven't found a workaround. Any thoughts?
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit dem get_submodules-Beispiel sowie den Aufrufen repo.update_submodules und repo.lookup_submodule. Reproduziere die verschachtelte Struktur, in der Submodule A mehr als einmal erscheint, und untersuche anschließend, wie wiederholte Aktualisierungen behandelt werden. Die Aufgabe ist erledigt, wenn die rekursive Operation für diese Struktur nicht mehr abstürzt und das Verhalten anhand des gemeldeten Szenarios verifiziert wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- git, python
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 32/100