ValueError `repo.branches.get('branch_no_exist/')` trailing slashes in branch names
オープン
まだ誰も着手していません。
bug
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 408
- 平均マージ
- 2日 57分
- マージ済み PR(30日)
- 7
説明
if i have a repo and call
>> 'branch_no_exist' in repo.branches
False
as expected, but
>> 'branch_no_exist/' in repo.branches
Traceback (most recent call last):
pygit2/repository.py", line 1156, in get
return self[key]
pygit2/repository.py", line 1144, in __getitem__
branch = self._repository.lookup_branch(name, GIT_BRANCH_LOCAL)
ValueError: cannot locate local branch 'branch_no_exist/'
Given branch names Shouldn't end in a slash, but the error is not complaining about this.
should repository.lookup_branch be returning None in this case?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
pygit2/repository.py の get メソッドと traceback に示されている getitem パスから始め、末尾のスラッシュがある場合とない場合で、存在しないブランチの検索を再現します。既存のブランチ検索テストを確認し、完了条件を、末尾のスラッシュがあるケースを一貫して処理することと定義し、回帰テストでカバーします。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- git, python
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 38/100