libgit2 / libgit2/pygit2

branch upstream_name InvalidRefSpec error on literal remote values for branch

オープン
#865 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

libgit2
主要言語
Python
スター
1.7k
フォーク
408
平均マージ
2日 57分
マージ済み PR(30日)
7

説明

when using hub (https://hub.github.com) to checkout pull requests, it generates a config entry for the branch with the direct reference to the remote git url instead of adding in a remote. This seems to cause some confusion for pygit, specifically iy will end up throwing an InvalidSpecError as pygit tries to follow the remote as a name instead of being to handle a literal git repo value. I'd suggest in such a case pygit simply return the remote name.

https://github.com/libgit2/pygit2/blob/master/src/branch.c#L245

$ branch
<_pygit2.Branch object at 0x10d1197b0>
$ branch.upstream_name
*** _pygit2.InvalidSpecError: 'https://github.com/steveparker-1984/cloud-custodian.git' is not a valid remote name.

entry in .git/config

[branch "fail-on-assume-role-error"]
        remote = https://github.com/steveparker-1984/cloud-custodian.git
        merge = refs/heads/fail-on-assume-role-error

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず src/branch.c の 245 行目付近を調べ、branch.remote にリテラルの HTTPS 値を指定して、示されている設定を再現します。その値に対する branch.upstream_name の処理を追跡します。InvalidSpecError が発生しなくなり、要求された remote 名の動作に従えば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
git, python
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。