GOTCHA: Sometimes len(pygit2.Repository().index) > 0 !
還沒有人認領這個 Issue。
評估
研究方向
首先使用 Python 3.10.6 和 pygit2 1.10.1 重現範例,尤其是對 pygit2.Repository().index 的呼叫及其項目。追蹤新儲存庫的索引為何包含 aaaa 和 bbbb,接著確立空索引的預期行為,並透過回歸涵蓋率驗證修正。
由索引模型根據 Issue 內容生成。
描述
Python 3.10.6 (main, Aug 10 2022, 11:40:04) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygit2
>>> len(pygit2.Repository().index)
2
>>> for item in pygit2.Repository().index: print(item)
...
<path=aaaa id=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 mode=33188>
<path=bbbb id=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 mode=33188>
>>> pygit2.__version__
'1.10.1'
This really surprised me, and I spent over 2 hours wondering why my code did not work before I thought maybe there's a bug.
With hindsight, I think it will be easy to reproduce. Ask me if you want help with this.
I will use index.clear() as a work-around.
- 主要語言
- Python
- 星號
- 1.7k
- 分支
- 409
- 平均合併
- 1 天 21 小時
- 30 天內合併 PR
- 4
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
libgit2/pygit2 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
-
難度 1/5 1 小時以內 新手友好度 88/100
-
Feature Request: Support app-level temporary config overrides using libgit2's backend supprt可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 4/5 3-5 天 新手友好度 45/100
-
難度 3/5 1-2 天 新手友好度 48/100
-
難度 3/5 1-2 天 新手友好度 55/100
相似的 Issue
-
難度 1/5 1-3 小時 新手友好度 87/100
adri0/scadustats#128 ·
維護者通常 1 天內回覆
-
`TIMESTAMP`, `TIMESTAMP_NTZ`, `TINYINT` and the other `TypeDecorator`s don't declare `python_type`未關閉
難度 2/5 1-3 小時 新手友好度 78/100
-
RPBC未關閉awaiting policy acceptance precheck-passed
難度 1/5 1 小時以內 新手友好度 78/100
Bioconductor/BiocContributions#240 · 1 則留言 ·
-
bug
難度 2/5 1-3 小時 新手友好度 78/100
維護者通常 1 天內回覆
-
documentation good first issue launch
難度 2/5 1-3 小時 新手友好度 83/100
FlologixAI/etchwork#4 ·