libgit2sharp icon indicating copy to clipboard operation
libgit2sharp copied to clipboard

Diff compare with DiffTargets.WorkingDirectory is terribly slow

Open kboom opened this issue 2 years ago • 1 comments

Reproduction steps

Compare commit to the working tree directory on a relatively big repository

 repository.Diff.Compare<TreeChanges>(
              repository.Head.Tip.Tree,
              DiffTargets.WorkingDirectory)

which takes a long time or never completes. Comparing the working trees of two commits works instantly

                    var branchDiffResult = repository.Diff.Compare<TreeChanges>(
                       targetCommit.Tree,
                        repository.Head.Tip.Tree,
                        compareOptions);

Additionally, doing repository.RetrieveStatus() is also slow, but not that slow.

Expected behavior

The speed of the two matches.

Actual behavior

Comparing to working directory is terribly slow.

Version of LibGit2Sharp (release number or SHA1)

0.27.0.0

Operating system(s) tested; .NET runtime tested

4.72, windows 11

kboom avatar Jan 27 '23 09:01 kboom

I encounter the same problem.

LJN-hzleaper avatar Feb 02 '23 06:02 LJN-hzleaper