libgit2 / libgit2/libgit2sharp

Commands.Stage() fails with a submodule

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

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

主要言語
C#
スター
3.5k
フォーク
925
PR マージ指標
30日以内にマージされた PR はありません

説明

Reproduction steps
  1. Add a submodule to a Git repository like git submodule add ../test-module test-module
  2. Change the commit of the submodule like cd test-module; git checkout -b branch-name
  3. Try to stage the submodule using libgit2sharp with Commands.Stage("*") or with Commands.Stage("test-module")
Expected behavior

The submodule change should be staged.

Actual behavior

An exception is thrown because git_index_add_bypath() failed because the path is invalid: test-module/

Commands.Stage() adds a slash at the end of the submodule name it passes to git_index_add_bypath which causes it to fail. git_index_add_bypath works fine passing it test-module directly with repo.Index.Add("test-module") (which is a workaround I'll use for now).

Version of LibGit2Sharp (release number or SHA1)

LibGit2Sharp 0.26.2

Operating system(s) tested; .NET runtime tested

.NET Framework 4.7.2 on Windows 10

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

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

はじめの一歩

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

調査の方向性

Commands.Stage のエントリポイントから開始し、Commands.Stage("*") と Commands.Stage("test-module") を使って説明されているサブモジュールのケースを再現します。そのパス処理を、回避策として報告されている repo.Index.Add("test-module") と比較します。変更されたサブモジュールを末尾のスラッシュによるパスエラーなしでステージングできれば完了です。

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

評価

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

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

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