0

I try to use libgit2sharp.Patch to find how much line added or deleted, but i got an error while i try to run it. When i run my asp.net mvc project in debug mode, it doesn't have any problem, until i run it without debug mode, i got my web load too long and didn't show the page. When i run in debug mode again, finally an error appear from libgit2sharp.Patch variable with error message system.outofmemory. This is how i implement libgit2sharp.Patch

Patch treePatchInfo = repo.Diff.Compare<Patch>(firstTree, compareTree, null, compareOptions: compareOptions);
                    commitChangeValue = from s in treeChangeInfo
                                        let patch = treePatchInfo[s.Path]
                                        select new CommitChangeModel
                                        {
                                            ChangeKind = s.Status,
                                            LinesAdded = patch.LinesAdded,
                                            LinesDeleted = patch.LinesDeleted,
                                            OldPath = s.Path,
                                            Patch = patch.Patch,
                                            Path = s.Path
                                        };
aji
  • 651
  • 1
  • 5
  • 10

1 Answers1

0

If you're only interested in number of additions/removal per file, I'd suggest you to rather rely on the following construct would be more efficient.

var stats = repo.Diff.Compare<PatchStats>(...);

You can take a peek at PR #660 where it's been introduced to get a first grasp of its usage.

Note: Regarding the OOM Exception, we'd very interested in getting more information about it. Would you be so kind as to open an issue in the bug tracker so that we can get a deeper look at it?

nulltoken
  • 64,429
  • 20
  • 138
  • 130
  • It only work if i run my project in debug mode, but when i run it whit ctrl+f5 i got my localhost load in a long time and the page doesn't appear after that, i don't know it still in OOM or not because it only got an error when i run it not in debug mode, maybe you have another solution. – aji Jun 16 '14 at 12:34