diff options
author | nulltoken <emeric.fermas@gmail.com> | 2012-11-27 23:07:54 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-11-29 20:15:56 +0400 |
commit | c57f25825adb771919d93f8c6cc539a91bcce467 (patch) | |
tree | 4747723d2b99a5e861d302d7ed7bcab139fd006e /LibGit2Sharp/Diff.cs | |
parent | da671ee1260d19af5c9d6887f42c60c74c7782ef (diff) |
Make Diff.Compare() able to compare null Trees
Diffstat (limited to 'LibGit2Sharp/Diff.cs')
-rw-r--r-- | LibGit2Sharp/Diff.cs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/LibGit2Sharp/Diff.cs b/LibGit2Sharp/Diff.cs index 0e8b4742..0d39e79a 100644 --- a/LibGit2Sharp/Diff.cs +++ b/LibGit2Sharp/Diff.cs @@ -70,11 +70,11 @@ namespace LibGit2Sharp /// <returns>A <see cref = "TreeChanges"/> containing the changes between the <paramref name = "oldTree"/> and the <paramref name = "newTree"/>.</returns> public virtual TreeChanges Compare(Tree oldTree, Tree newTree, IEnumerable<string> paths = null) { - Ensure.ArgumentNotNull(oldTree, "oldTree"); - Ensure.ArgumentNotNull(oldTree, "newTree"); - using(GitDiffOptions options = BuildOptions(paths)) - using (DiffListSafeHandle diff = BuildDiffListFromTrees(oldTree.Id, newTree.Id, options)) + using (DiffListSafeHandle diff = BuildDiffListFromTrees( + oldTree != null ? oldTree.Id : null, + newTree != null ? newTree.Id : null, + options)) { return new TreeChanges(diff); } |