From efb0b1091fc15e270c7391d401721a73489b6380 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sat, 17 Dec 2016 15:31:38 +0000 Subject: [PATCH 1/6] Correct the order of arguments for an assertion --- LibGit2Sharp.Tests/ConfigurationFixture.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LibGit2Sharp.Tests/ConfigurationFixture.cs b/LibGit2Sharp.Tests/ConfigurationFixture.cs index ee49fd249..42da034d0 100644 --- a/LibGit2Sharp.Tests/ConfigurationFixture.cs +++ b/LibGit2Sharp.Tests/ConfigurationFixture.cs @@ -497,7 +497,7 @@ public void CanAppendToSearchPaths() GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, "$PATH", appendMe); var currentPaths = GlobalSettings.GetConfigSearchPaths(ConfigurationLevel.Global); - Assert.Equal(currentPaths, prevPaths.Concat(new[] { appendMe })); + Assert.Equal(prevPaths.Concat(new[] { appendMe }), currentPaths); // set it back to the default GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, null); From 00540368baf96c7eca98ef82c928510fe53eb4ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sat, 17 Dec 2016 15:48:23 +0000 Subject: [PATCH 2/6] Don't try to reset the path by passing in empty strings The only documented way of resetting a search path is by passing null, all these other variants may have worked at some point, but that was pure coincidence. --- LibGit2Sharp.Tests/ConfigurationFixture.cs | 27 +++++----------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/LibGit2Sharp.Tests/ConfigurationFixture.cs b/LibGit2Sharp.Tests/ConfigurationFixture.cs index 42da034d0..7edc6dab3 100644 --- a/LibGit2Sharp.Tests/ConfigurationFixture.cs +++ b/LibGit2Sharp.Tests/ConfigurationFixture.cs @@ -455,15 +455,6 @@ public void CanSetAndGetMultipleSearchPaths() [Fact] public void CanResetSearchPaths() { - // all of these calls should reset the config path to the default - Action[] resetActions = - { - () => GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global), - () => GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, null), - () => GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, string.Empty), - () => GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, new string[] { }), - }; - // record the default search path GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, null); var oldPaths = GlobalSettings.GetConfigSearchPaths(ConfigurationLevel.Global); @@ -472,19 +463,13 @@ public void CanResetSearchPaths() // generate a non-default path to set var newPaths = new string[] { Path.Combine(Constants.TemporaryReposPath, Path.GetRandomFileName()) }; - foreach (var tryToReset in resetActions) - { - // change to the non-default path - GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, newPaths); - Assert.Equal(newPaths, GlobalSettings.GetConfigSearchPaths(ConfigurationLevel.Global)); - - // set it back to the default - tryToReset(); - Assert.Equal(oldPaths, GlobalSettings.GetConfigSearchPaths(ConfigurationLevel.Global)); - } + // change to the non-default path + GlobalSettings.SetConfigSearchPaths (ConfigurationLevel.Global, newPaths); + Assert.Equal (newPaths, GlobalSettings.GetConfigSearchPaths (ConfigurationLevel.Global)); - // make sure the config paths are reset after the test ends - GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, null); + // set it back to the default + GlobalSettings.SetConfigSearchPaths (ConfigurationLevel.Global, null); + Assert.Equal (oldPaths, GlobalSettings.GetConfigSearchPaths (ConfigurationLevel.Global)); } [Fact] From bf111252f576f645570c78ba3732fe5214fa75f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sat, 17 Dec 2016 19:35:55 +0000 Subject: [PATCH 3/6] Specify a sorting method in in the file history test --- LibGit2Sharp.Tests/FileHistoryFixture.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/LibGit2Sharp.Tests/FileHistoryFixture.cs b/LibGit2Sharp.Tests/FileHistoryFixture.cs index c74165fcf..7f7a94b4c 100644 --- a/LibGit2Sharp.Tests/FileHistoryFixture.cs +++ b/LibGit2Sharp.Tests/FileHistoryFixture.cs @@ -161,7 +161,8 @@ public void CanTellComplexCommitHistory() var commit4 = MakeAndCommitChange(repo, repoPath, newPath1, "I have done it again!"); // Perform tests. - var fileHistoryEntries = repo.Commits.QueryBy(newPath1).ToList(); + var commitFilter = new CommitFilter () { SortBy = CommitSortStrategies.Topological }; + var fileHistoryEntries = repo.Commits.QueryBy(newPath1, commitFilter).ToList(); var changedBlobs = fileHistoryEntries.Blobs().Distinct().ToList(); Assert.Equal(4, fileHistoryEntries.Count()); From abe8c2c19542deea8c00a94a0ea2d9e4a68c1ef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Sat, 17 Dec 2016 19:36:37 +0000 Subject: [PATCH 4/6] Add new fields to changed structs --- LibGit2Sharp/Core/GitDiff.cs | 1 + LibGit2Sharp/Core/GitOdbBackend.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/LibGit2Sharp/Core/GitDiff.cs b/LibGit2Sharp/Core/GitDiff.cs index d8fa72a44..eb21d6881 100644 --- a/LibGit2Sharp/Core/GitDiff.cs +++ b/LibGit2Sharp/Core/GitDiff.cs @@ -397,6 +397,7 @@ internal class GitDiffBinaryFile [StructLayout(LayoutKind.Sequential)] internal class GitDiffBinary { + public uint ContainsData; public GitDiffBinaryFile OldFile; public GitDiffBinaryFile NewFile; } diff --git a/LibGit2Sharp/Core/GitOdbBackend.cs b/LibGit2Sharp/Core/GitOdbBackend.cs index e36cdc531..f5335655e 100644 --- a/LibGit2Sharp/Core/GitOdbBackend.cs +++ b/LibGit2Sharp/Core/GitOdbBackend.cs @@ -34,6 +34,7 @@ static GitOdbBackend() public IntPtr Refresh; public foreach_callback Foreach; public IntPtr Writepack; + public IntPtr Freshen; public free_callback Free; /* The libgit2 structure definition ends here. Subsequent fields are for libgit2sharp bookkeeping. */ From 88c818db828d3a612a72262e4cf22bcfd4edc4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Fri, 23 Dec 2016 15:22:26 +0000 Subject: [PATCH 5/6] Update native binaries to 75db289a --- LibGit2Sharp/LibGit2Sharp.csproj | 18 +++++++++--------- LibGit2Sharp/packages.config | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/LibGit2Sharp/LibGit2Sharp.csproj b/LibGit2Sharp/LibGit2Sharp.csproj index e436644ab..6156af63b 100644 --- a/LibGit2Sharp/LibGit2Sharp.csproj +++ b/LibGit2Sharp/LibGit2Sharp.csproj @@ -1,6 +1,6 @@  - + Debug AnyCPU @@ -366,11 +366,11 @@ - TextTemplatingFileGenerator Objects.cs + @@ -380,12 +380,6 @@ - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + \ No newline at end of file diff --git a/LibGit2Sharp/packages.config b/LibGit2Sharp/packages.config index ee6d18e01..db6ebf4c3 100644 --- a/LibGit2Sharp/packages.config +++ b/LibGit2Sharp/packages.config @@ -1,4 +1,4 @@  - - + + \ No newline at end of file From 2504d772432b5921ebe6729b8d7545d0b0469315 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Fri, 23 Dec 2016 16:13:51 +0000 Subject: [PATCH 6/6] travis: ask for the xcode6.4 image The newer image does not find mono 3.12 in PATH so our build fails with that. --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index d0e35f585..12830d15a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,9 @@ os: - osx - linux +# The newer image cannot find mono 3.12 in the PATH +osx_image: xcode6.4 + env: global: - MONO_OPTIONS=--debug