libgit2 / libgit2/libgit2sharp
Commands.Move is different from git mv
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- C#
- Sterne
- 3.5k
- Forks
- 925
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne am Einstiegspunkt Commands.Move und reproduziere den bereitgestellten oldPath/newPath-Fall, wobei du dessen resultierendes git log mit dem Verhalten des Befehlszeilenbefehls git mv vergleichst. Die Aufgabe ist erledigt, wenn der Verhaltensunterschied erklärt ist und für das Issue entweder ein bestätigter Fix oder dokumentiertes erwartetes Verhalten vorliegt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp, git
- Bereich
- devtools
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100