update_submodules duplicates
還沒有人認領這個 Issue。
評估
研究方向
從 get_submodules 範例以及 repo.update_submodules 和 repo.lookup_submodule 呼叫開始。重現 Submodule A 出現多次的巢狀配置,然後檢查重複更新是如何處理的。當遞迴操作在該配置下不再崩潰,且已根據所回報的情境驗證行為時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
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?
- 主要語言
- Python
- 星號
- 1.7k
- 分支
- 408
- 平均合併
- 2 天 57 分鐘
- 30 天內合併 PR
- 7
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
libgit2/pygit2 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 1/5 1 小時以內 新手友好度 88/100
-
難度 4/5 3-5 天 新手友好度 45/100
-
難度 3/5 1-2 天 新手友好度 48/100
-
難度 3/5 1-2 天 新手友好度 55/100
相似的 Issue
-
bug
難度 2/5 1-3 小時 新手友好度 86/100
zostera/django-bootstrap4#894 ·
-
難度 2/5 1-3 小時 新手友好度 78/100
use-agent-os/agent-os#3276 ·
-
難度 2/5 1-3 小時 新手友好度 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
難度 2/5 1-3 小時 新手友好度 88/100
NousResearch/hermes-agent#117848 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
zilliztech/memsearch#759 ·