Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

How do you clear a conflict state on a single file #325

Closed
yishaigalatzer opened this Issue Feb 10, 2013 · 3 comments

Comments

Projects
None yet
2 participants

I have a state where conflicts are created by the msysgit pull command.

It's fairly easy (though not well documented) to get the state of the file by iterating the index entries and comparing paths (thanks @ethomson!).

foreach (var entry in _repository.Index)
{
if (entry.StageLevel != StageLevel.Staged)
{
yield return entry.Path;
}
}

I also noticed (correctly or not) that if I unstage the conflicted file, I can now proceed to commit the changes in the file on disk.

However I couldn't find a way to do a similar when the user decides to delete the conflict file. (Well except for ugly hacks I'm embarrassed to mention here).

Any suggestions?

Owner

ethomson commented Feb 10, 2013

Doh. We added a new method in libgit2 that will move conflicts to the REUC when deleting a file from the index. My intent was to update libgit2sharp once we updated the binary dependency. I think they've been updated and I missed my opportunity. Let me take a look at this.

My intent is that Remove should clear the conflict just like Add does.

Thanks Ed. I'll wait for your PR to come through.

I also opened a separate issue to track conflict resolution for a single file without actually staging/add/removing it. Its necessary for a fundamental conflict resolution flow. More details in issue #328

Any news?

@nulltoken nulltoken referenced this issue Apr 20, 2013

Closed

Add a bunch of stuffs to Index.Remove() #398

4 of 4 tasks complete

yorah added a commit to yorah/libgit2sharp that referenced this issue Apr 23, 2013

Add test to ensure conflicts are cleared when calling Index.Remove()
Beware, this is supported only for files which exist in the workdir (cf. comment in code).
Partially fixes #325

yorah added a commit to yorah/libgit2sharp that referenced this issue Apr 23, 2013

Add test to ensure conflicts are cleared when calling Index.Remove()
Beware, this is supported only for files which exist in the workdir (cf. comment in code).
Partially fixes #325

@nulltoken nulltoken closed this in 56eb34b Apr 24, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment