libgit2 / libgit2/libgit2sharp

Repository.Reset doesn't checkout files having only a single line's line ending changed

未關閉
#1,327 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
C#
星號
3.5k
分支
925
PR 合併指標
30 天內沒有已合併 PR

描述

If the line ending of only one line somewhere in the middle of a file, the file is not detected as Dirty by the reset method and the change is not reverted after calling it.

On the other hand Repository.RetrieveStatus correctly returns the file as modified

I'm attaching a test repo which shows the issue with version v0.22 from NuGet (Note that I had to change the zip file's extension to txt because otherwise GitHub rejected it for some reason...).

test-repo.zip.txt

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從附帶的測試儲存庫以及 Repository.Reset 和 Repository.RetrieveStatus 進入點開始。比較它們各自如何處理一個行尾發生變更的檔案;完成的標準是 Reset 將該檔案偵測為 Dirty 並還原該變更,同時有一個涵蓋此情況的回歸測試。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
csharp, git
領域
devtools
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。