libgit2/libgit2sharp — pull request #481 by freevoid (2013-08-07 04:18:42+00:00)
Title: Skip building diff patch while doing stage/reset

TreeChanges constructor always builds diff string in TreeChanges.fullPatchBuilder (and additionally adds diff string in per-file TreeChanges.changes dictionary).

This behavior leads to wasting time and memory in Index.Stage and Index.Reset methods. In our particular case, it fails with System.OutOfMemoryException in attempt to build full patch for a big initial commit.

This change adds a flag to CompareOptions to be able to skip building patch where it is not required.