libgit2 / libgit2/pygit2

"this operation is only valid for push"

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

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

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

説明

The sequence of calls

remote.ls_remotes(...)
remote.fetch(...)
remote.push(...)

works, while

remote.ls_remotes(...)
remote.push(...)

doesn't, producing the GIT_ERROR_NET / "this operation is only valid for push" error.

I think this is because ls_remotes() explicitly calls connect(..., GIT_DIRECTION_FETCH), and fetch() implicitly calls disconnect() (within git_remote_fetch()). If fetch() is not called between ls_remotes() and push(), git_remote_push() encounters an existing connection with FETCH direction, and returns an error (from git_smart__get_push_stream()).

This could be addressed in several ways: either by disconnecting explicitly in ls_remotes(), or maybe by changing the implementation of connect_or_reset_options() and the functions it calls to handle the case where direction is changing.

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

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

はじめの一歩

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

調査の方向性

まず remote.ls_remotes()、remote.fetch()、remote.push() を使って2つの呼び出しシーケンスを再現し、次に connect_or_reset_options() と、issueで説明されている git_remote_push() のパスを調査します。ls_remotes() の直後に直接 push しても GIT_ERROR_NET エラーなしで成功し、そのシーケンスに対するリグレッションカバレッジがあることを完了条件とします。

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

評価

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

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

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