libgit2 / libgit2/libgit2sharp

Commands.Move is different from git mv

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

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

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

説明

If I use git mv from the command line, I do not lose my history. It is a rename in the history.

If I use Commands.Move it looks in the git log like a file delete and a file create, therefore losing my history. The file is renamed in the file system, but git didn't see the rename.

I'm using libgit2sharp version 0.31.0 with VS 2022 building with .NET 8 and C# version 13 on Windows 11.

My code looks like:

try
{
    using (var repo = new Repository(repoRoot))
    {
        // Moves the file. Path must be in Posix format (using '/' as path separator)
        Commands.Move(repo, oldPath, newPath);
        ok = true;
    }
}
catch (Exception ex)
{
    Error = "Git Move exception: " + ex.Message;
}

Am I doing something wrong? I convert the Windows path format to Posix format before using them.

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

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

はじめの一歩

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

調査の方向性

Commands.Move エントリポイントから開始し、提供された oldPath/newPath のケースを再現して、その結果の git log をコマンドラインの git mv の動作と比較します。動作の違いが説明され、issue に確認済みの修正または文書化された想定動作があることをもって完了とします。

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

評価

技術スタック
csharp, git
領域
devtools
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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