Вопрос

I am a bit confused whether LibGit2Sharp supports detecting renamed files or not. I have a program which uses the LibGit2Sharp library. I can detect Unaltered files and modified files but i cannot detect renamed files.

RetrieveStatus (String)

The files are created in a c# program, so I know which files I renamed. Is it possible to change the filestatus of a file in LibGit2Sharp to "renamed"?

I want to get the history of a file but sometimes this file is renamed. I want to get the full history, meaning also the renamed files. What would be the best approach for this?

Thank you very much!

Это было полезно?

Решение

Detection of renaming though the Index.RetrieveStatus() API has been introduced in LibGit2Sharp with PR #523.

For performance reasons, by default, detection of renamed files isn't done. One have to explicitly set the behavioral flags through the StatusOptions type.

The StatusFixture.cs suite showcases some renaming detection tests that should help you tackle this.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top