Libgit2sharp CheckoutPaths() doesn't undo changes on file with status "NewInIndex, ModifiedInWorkdir".
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 45/100
Piste de recherche
Commencez par l’CheckoutPaths API et reproduisez la transition d’état signalée pour un fichier marqué comme NewInIndex, ModifiedInWorkdir en utilisant le chemin et les CheckoutOptions fournis. Vérifiez que le checkout forcé restaure le contenu indexé et laisse le fichier avec l’état NewInIndex, en prenant comme référence le comportement signalé de LibGit2Sharp 0.26.2.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
You are opening a bug report against the LibGit2Sharp project: we
use GitHub Issues for tracking bug reports and feature requests. If
you have a question about an API or usage, please ask on StackOverflow:
http://stackoverflow.com/questions/tagged/libgit2sharp.
Otherwise, to report a bug, please fill out the reproduction steps
(below) and delete these introductory paragraphs. Thanks!
Reproduction steps
I have a file inside many folders (for ex : docs/jsons/myfile.json ) in my repository
I staged the file , so it now has the status "NewInIndex".
After that i made changes on that file.
It has now the status "NewInIndex, ModifiedInWorkdir".
My code is the following :
using ( var repo = new Repository("my repo path")
{
CheckoutOptions options = new CheckoutOptions { CheckoutModifiers = CheckoutModifiers.Force };
repo.CheckoutPaths(repo.Head.FriendlyName, new string[] {"docs/jsons/myfile.json"} , options );
}
I also tried to replace " repo.Head.FriendlyName" by "repo.Head.CannonicalName" and by "repo.Head.Tip.Id.Sha"
Expected behavior
I expect the file to get back to its previous content, and to have the status "NewInIndex" again.
Actual behavior
The file's content doesnt change and its status is still : "NewInIndex, ModifiedInWorkdir".
Version of LibGit2Sharp (release number or SHA1)
LibGit2Sharp version 0.26.2
Operating system(s) tested; .NET runtime tested
Window 10 Enterprise
.NET 6.0
- Langage dominant
- C#
- Étoiles
- 3.5k
- Forks
- 925
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de libgit2/libgit2sharp
-
Difficulté 4/5 3-5 jours Accessibilité débutants 52/100
libgit2/libgit2sharp#2193 · 2 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 38/100
libgit2/libgit2sharp#2192 · 1 commentaire ·
-
Website is down Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 20/100
libgit2/libgit2sharp#2191 · 2 réactions ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 68/100
libgit2/libgit2sharp#2189 · 1 réaction ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 35/100
libgit2/libgit2sharp#2187 · 2 commentaires ·
Toutes les issues de libgit2/libgit2sharp
Issues similaires
-
Add more to the documentation Ouverte:watch: Not Triaged dotnet-fsharp/svc
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
Client customer-reported needs-team-attention question Service Attention WebPubSub
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Azure/azure-sdk-for-net#63292 · 3 commentaires · 1 réaction ·
-
Issue-Enhancement Needs-Triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 86/100
PowerShell/PowerShell#28061 · 2 réactions ·
-
dependencies needs-team-triage server-Azure.Mcp
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
aspnet-core/svc aspnetcore-signalr/subsvc doc-enhancement Pri2 SignalR
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
dotnet/AspNetCore.Docs#37729 ·