From 5b6e65437fb2eed01f8481f081f297cf6488c894 Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 16 Jan 2018 04:00:02 -0800 Subject: [PATCH 1/2] Update packages --- Build-Solution.ps1 | 9 +++- SeeGit.msbuild | 4 +- SeeGitApp/App.config | 2 +- SeeGitApp/Extensions/LibGit2Extensions.cs | 10 ++--- SeeGitApp/SeeGitApp.csproj | 16 +++++-- SeeGitApp/packages.config | 3 +- UnitTests/App.config | 27 ++++++++---- UnitTests/Models/BranchCollectionTests.cs | 4 +- UnitTests/Models/CommitVertexTests.cs | 6 +-- UnitTests/Models/SettingsTests.cs | 4 +- UnitTests/UnitTests.csproj | 51 ++++++++++++++++++----- UnitTests/packages.config | 19 +++++---- 12 files changed, 109 insertions(+), 46 deletions(-) diff --git a/Build-Solution.ps1 b/Build-Solution.ps1 index 8dd13e4..9c2207c 100644 --- a/Build-Solution.ps1 +++ b/Build-Solution.ps1 @@ -13,5 +13,10 @@ param( $scriptPath = Split-Path $MyInvocation.MyCommand.Path $projFile = join-path $scriptPath SeeGit.msbuild - -& "$(get-content env:programfiles)\MSBuild\14.0\Bin\msbuild.exe" $projFile /t:$build /p:Configuration=$config /verbosity:$MSBuildVerbosity +$dotNetVersion = "4.0" +$regKey = "HKLM:\software\Microsoft\MSBuild\ToolsVersions\$dotNetVersion" +$regProperty = "MSBuildToolsPath" + +$msbuildExe = join-path -path (Get-ItemProperty $regKey).$regProperty -childpath "msbuild.exe" + +& $msbuildExe $projFile /t:$build /p:Configuration=$config /verbosity:$MSBuildVerbosity diff --git a/SeeGit.msbuild b/SeeGit.msbuild index a5067f7..f97c3f7 100644 --- a/SeeGit.msbuild +++ b/SeeGit.msbuild @@ -3,7 +3,7 @@ Debug - + @@ -14,7 +14,7 @@ - + diff --git a/SeeGitApp/App.config b/SeeGitApp/App.config index 9e076ce..635c1a6 100644 --- a/SeeGitApp/App.config +++ b/SeeGitApp/App.config @@ -23,4 +23,4 @@ --> - + diff --git a/SeeGitApp/Extensions/LibGit2Extensions.cs b/SeeGitApp/Extensions/LibGit2Extensions.cs index 1c8781c..d455e2c 100644 --- a/SeeGitApp/Extensions/LibGit2Extensions.cs +++ b/SeeGitApp/Extensions/LibGit2Extensions.cs @@ -5,11 +5,11 @@ public static class LibGit2Extensions public static BranchReference ToBranchReference(this LibGit2Sharp.Branch branch) { return new BranchReference - { - Name = branch.Name, - IsRemote = branch.IsRemote, - IsHead = branch.IsCurrentRepositoryHead - }; + { + Name = branch.CanonicalName, + IsRemote = branch.IsRemote, + IsHead = branch.IsCurrentRepositoryHead + }; } } } \ No newline at end of file diff --git a/SeeGitApp/SeeGitApp.csproj b/SeeGitApp/SeeGitApp.csproj index 9c578e0..81ab75a 100644 --- a/SeeGitApp/SeeGitApp.csproj +++ b/SeeGitApp/SeeGitApp.csproj @@ -1,6 +1,6 @@  - + Debug x86 @@ -11,7 +11,7 @@ Properties SeeGit SeeGit - v4.6 + v4.6.2 512 @@ -20,6 +20,8 @@ true 4.0.30816.0 ..\ + + true @@ -50,8 +52,8 @@ False ..\packages\GraphSharp.1.1.0.0\lib\net40\GraphSharp.Controls.dll - - ..\packages\LibGit2Sharp.0.21.0.176\lib\net40\LibGit2Sharp.dll + + ..\packages\LibGit2Sharp.0.24.0\lib\net40\LibGit2Sharp.dll True @@ -187,4 +189,10 @@ + + + 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/SeeGitApp/packages.config b/SeeGitApp/packages.config index 1d7b450..3266fd1 100644 --- a/SeeGitApp/packages.config +++ b/SeeGitApp/packages.config @@ -1,7 +1,8 @@  - + + diff --git a/UnitTests/App.config b/UnitTests/App.config index cb1e5f1..dda47ef 100644 --- a/UnitTests/App.config +++ b/UnitTests/App.config @@ -1,28 +1,41 @@ - + - - + + - + - + - + - + + + + + + + + + + + + + + diff --git a/UnitTests/Models/BranchCollectionTests.cs b/UnitTests/Models/BranchCollectionTests.cs index 8657be0..be4e501 100644 --- a/UnitTests/Models/BranchCollectionTests.cs +++ b/UnitTests/Models/BranchCollectionTests.cs @@ -15,7 +15,7 @@ public void AddsBranchToCollection() branches.Merge(new SeeGit.BranchReference {Name = "foo"}); - Assert.Equal(1, branches.Count); + Assert.Single(branches); } [Fact] @@ -26,7 +26,7 @@ public void MergesBranchWithSameNameAsExistingGivingPrecedenceToNewerOne() branches.Merge(new SeeGit.BranchReference {Name = "foo", IsCurrent = true, IsRemote = true, IsHead = true}); - Assert.Equal(1, branches.Count); + Assert.Single(branches); Assert.True(branches.First().IsCurrent); } } diff --git a/UnitTests/Models/CommitVertexTests.cs b/UnitTests/Models/CommitVertexTests.cs index 019693f..ffcef79 100644 --- a/UnitTests/Models/CommitVertexTests.cs +++ b/UnitTests/Models/CommitVertexTests.cs @@ -16,8 +16,8 @@ public void SetsProperties() Assert.Equal("commit message", commit.Message); Assert.NotNull(commit.Branches); Assert.Equal(8, commit.ShaLength); - Assert.Equal(true, commit.AdornerMessageVisibility); // expanded is false -> true - Assert.Equal(false, commit.DescriptionShown); + Assert.True(commit.AdornerMessageVisibility); // expanded is false -> true + Assert.False(commit.DescriptionShown); } } @@ -47,7 +47,7 @@ public void ReturnsFalseIfShasAreDifferent() public void ReturnsFalseWhenComparedToNull() { var commit = new CommitVertex("sha", "message"); - CommitVertex other = null; + const CommitVertex other = null; Assert.False(commit.Equals(other)); Assert.False(object.Equals(commit, other)); diff --git a/UnitTests/Models/SettingsTests.cs b/UnitTests/Models/SettingsTests.cs index b14e7ea..ef63d7f 100644 --- a/UnitTests/Models/SettingsTests.cs +++ b/UnitTests/Models/SettingsTests.cs @@ -15,7 +15,7 @@ public void SetsProperties() var settings = new Settings(); // Get From File Test - Assert.Equal(true, settings.GetSetting("TrueSetting", false)); + Assert.True(settings.GetSetting("TrueSetting", false)); // Default Setting Test Assert.Equal("default", settings.GetSetting("asdf", "default", true)); @@ -28,7 +28,7 @@ public void SetsProperties() Assert.Equal("False", settings.GetSetting("mySetting", String.Empty)); // Remove Setting - string fileValue = settings.GetSetting("ToBeRemovedSetting", "xmlvalue"); + var fileValue = settings.GetSetting("ToBeRemovedSetting", "xmlvalue"); settings.RemoveSetting("ToBeRemovedSetting"); Assert.NotEqual(fileValue, settings.GetSetting("ToBeRemovedSetting", "notthexml")); settings.Save(); diff --git a/UnitTests/UnitTests.csproj b/UnitTests/UnitTests.csproj index 029aeb8..8bea4c6 100644 --- a/UnitTests/UnitTests.csproj +++ b/UnitTests/UnitTests.csproj @@ -1,5 +1,7 @@  + + Debug AnyCPU @@ -10,10 +12,12 @@ Properties UnitTests UnitTests - v4.6 + v4.6.2 512 ..\ + + true @@ -37,6 +41,10 @@ false + + ..\packages\Castle.Core.4.2.1\lib\net45\Castle.Core.dll + True + False ..\packages\GraphSharp.1.1.0.0\lib\net40\GraphSharp.dll @@ -45,8 +53,8 @@ False ..\packages\GraphSharp.1.1.0.0\lib\net40\GraphSharp.Controls.dll - - ..\packages\Moq.4.2.1507.0118\lib\net40\Moq.dll + + ..\packages\Moq.4.8.1\lib\net45\Moq.dll True @@ -63,7 +71,16 @@ ..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Serialization.dll + + + ..\packages\System.Threading.Tasks.Extensions.4.4.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll + True + + + ..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll + True + @@ -73,19 +90,19 @@ ..\packages\WPFExtensions.1.0.0\lib\WPFExtensions.dll - ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll + ..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll True - - ..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll + + ..\packages\xunit.assert.2.3.1\lib\netstandard1.1\xunit.assert.dll True - - ..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll + + ..\packages\xunit.extensibility.core.2.3.1\lib\netstandard1.1\xunit.core.dll True - - ..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll + + ..\packages\xunit.extensibility.execution.2.3.1\lib\net452\xunit.execution.desktop.dll True @@ -112,5 +129,19 @@ + + + + + + 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/UnitTests/packages.config b/UnitTests/packages.config index c58319d..afb2b51 100644 --- a/UnitTests/packages.config +++ b/UnitTests/packages.config @@ -1,13 +1,18 @@  + - + + + - - - - - - + + + + + + + + \ No newline at end of file From 24ac395bcf49b86d495963346423039644415b6b Mon Sep 17 00:00:00 2001 From: Phil Haack Date: Tue, 16 Jan 2018 04:14:14 -0800 Subject: [PATCH 2/2] Use friendly name --- SeeGitApp/Extensions/LibGit2Extensions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SeeGitApp/Extensions/LibGit2Extensions.cs b/SeeGitApp/Extensions/LibGit2Extensions.cs index d455e2c..5250c15 100644 --- a/SeeGitApp/Extensions/LibGit2Extensions.cs +++ b/SeeGitApp/Extensions/LibGit2Extensions.cs @@ -6,7 +6,7 @@ public static BranchReference ToBranchReference(this LibGit2Sharp.Branch branch) { return new BranchReference { - Name = branch.CanonicalName, + Name = branch.FriendlyName, IsRemote = branch.IsRemote, IsHead = branch.IsCurrentRepositoryHead };