Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Upgrade LibGit2Sharp to 0.26.0-preview-0070 #51

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/GitTools.Core.Tests/Git/DynamicRepositoriesTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void WorksCorrectlyWithRemoteRepository(string branchName, string expecte
{
using (var fixture = new EmptyRepositoryFixture())
{
var expectedDynamicRepoLocation = Path.Combine(tempPath, fixture.RepositoryPath.Split(Path.DirectorySeparatorChar).Last());
var expectedDynamicRepoLocation = Path.Combine(tempPath, fixture.RepositoryPath.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries).Last());

fixture.Repository.MakeCommits(5);
fixture.Repository.CreateFileAndCommit("TestFile.txt");
Expand All @@ -50,7 +50,7 @@ public void WorksCorrectlyWithRemoteRepository(string branchName, string expecte
using (var dynamicRepository = DynamicRepositories.CreateOrOpen(repositoryInfo, tempPath, branchName, branch.Tip.Sha))
{
dynamicRepositoryPath = dynamicRepository.Repository.Info.Path;
dynamicRepository.Repository.Info.Path.ShouldBe(Path.Combine(expectedDynamicRepoLocation, ".git\\"));
dynamicRepository.Repository.Info.Path.ShouldBe(Path.Combine(expectedDynamicRepoLocation, ".git" + Path.DirectorySeparatorChar));

var currentBranch = dynamicRepository.Repository.Head.CanonicalName;

Expand Down Expand Up @@ -130,7 +130,7 @@ public void PicksAnotherDirectoryNameWhenDynamicRepoFolderTaken()
{
var head = fixture.Repository.CreateFileAndCommit("TestFile.txt");
File.Copy(Path.Combine(fixture.RepositoryPath, "TestFile.txt"), Path.Combine(tempDir, "TestFile.txt"));
expectedDynamicRepoLocation = Path.Combine(tempPath, fixture.RepositoryPath.Split(Path.DirectorySeparatorChar).Last());
expectedDynamicRepoLocation = Path.Combine(tempPath, fixture.RepositoryPath.Split(new[] { Path.DirectorySeparatorChar }, StringSplitOptions.RemoveEmptyEntries).Last());
Directory.CreateDirectory(expectedDynamicRepoLocation);

var repositoryInfo = new RepositoryInfo
Expand All @@ -140,7 +140,7 @@ public void PicksAnotherDirectoryNameWhenDynamicRepoFolderTaken()

using (var dynamicRepository = DynamicRepositories.CreateOrOpen(repositoryInfo, tempPath, "master", head.Sha))
{
dynamicRepository.Repository.Info.Path.ShouldBe(Path.Combine(expectedDynamicRepoLocation + "_1", ".git\\"));
dynamicRepository.Repository.Info.Path.ShouldBe(Path.Combine(expectedDynamicRepoLocation + "_1", ".git" + Path.DirectorySeparatorChar));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/GitTools.Core.Tests/Git/GitRepositoryHelperTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public void GitHubFlowMajorRelease()
// fixture.AssertFullSemver("2.0.0");
fixture.MakeACommit();

#if !NETCOREAPP1_1
#if !NETCOREAPP2_0
fixture.Repository.DumpGraph();
#endif
// fixture.AssertFullSemver("2.0.1+1");
Expand Down
41 changes: 20 additions & 21 deletions src/GitTools.Core.Tests/GitTools.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">Any CPU</Platform>
<Platform Condition=" '$(Platform)' == '' ">Any CPU</Platform>
<OutputType>Library</OutputType>
<TargetFramework>net46</TargetFramework>
<TargetFrameworks>netcoreapp1.1;net46</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<DebugType>full</DebugType>
<OutputPath>..\..\output\debug\GitTools.Core.Tests\$(TargetFramework)\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\output\release\GitTools.Core.Tests\$(TargetFramework)\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>TRACE</DefineConstants>
</PropertyGroup>
<ItemGroup>

<ItemGroup>
<PackageReference Include="GitTools.Testing" Version="1.2.0" />
<PackageReference Include="NUnit" Version="3.7.1" />
<PackageReference Include="NUnit.ConsoleRunner" Version="3.7.0" />
Expand All @@ -29,20 +28,20 @@
<PackageReference Include="Shouldly" Version="2.8.3" />
</ItemGroup>

<ItemGroup Condition=" '$(Configuration)' == 'netcoreapp1.1' ">
<PackageReference Include="Atlassian.SDK" Version="9.5.0" />
<ItemGroup Condition=" '$(Configuration)' == 'netcoreapp2.0' ">
<PackageReference Include="Atlassian.SDK" Version="9.5.0" />
</ItemGroup>
<ItemGroup Condition=" '$(Configuration)' == 'net46' ">
<PackageReference Include="Atlassian.SDK" Version="2.5.0" />
</ItemGroup>

<ItemGroup Condition=" '$(Configuration)' == 'net461' ">
<PackageReference Include="Atlassian.SDK" Version="2.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\GitTools.Core\GitTools.Core.csproj" />
</ItemGroup>
<ProjectReference Include="..\GitTools.Core\GitTools.Core.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/GitTools.Core/Git/DynamicRepositories.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static string GetLockFile(string repoPath)

static string GetAndLockTemporaryRepositoryPath(string targetUrl, string dynamicRepositoryLocation)
{
var repositoryName = targetUrl.Split('/', '\\').Last().Replace(".git", string.Empty);
var repositoryName = targetUrl.Split(new[] { '/', '\\' }, StringSplitOptions.RemoveEmptyEntries).Last().Replace(".git", string.Empty);
var possiblePath = Path.Combine(dynamicRepositoryLocation, repositoryName);

var i = 1;
Expand Down
2 changes: 1 addition & 1 deletion src/GitTools.Core/Git/Extensions/LibGitExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public static void CheckoutFilesIfExist(this IRepository repository, params stri
}
}

#if !NETSTANDARD1_3
#if !NETSTANDARD2_0
public static void DumpGraph(this IRepository repository, Action<string> writer = null, int? maxCommits = null)
{
DumpGraph(repository.Info.Path, writer, maxCommits);
Expand Down
36 changes: 11 additions & 25 deletions src/GitTools.Core/GitTools.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<PropertyGroup>
<!--<TargetFramework>netstandard1.3</TargetFramework>-->
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard1.3;net45;net40</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>

<!--Start of Nuspec metadata-->
<PackageId>GitTools.Core</PackageId>
Expand All @@ -17,43 +17,29 @@
<PackageIconUrl>https://raw.github.com/GitTools/GitTools.Core/master/GitTools_logo.png</PackageIconUrl>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)' == 'net45'">
<DefineConstants>TRACE;NET45;NETDESKTOP</DefineConstants>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<DefineConstants>TRACE;NET461;NETDESKTOP</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net40'">
<DefineConstants>TRACE;NET40;NETDESKTOP</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<DefineConstants>TRACE;LIBLOG_PORTABLE;NETSTANDARD1_3;</DefineConstants>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>TRACE;LIBLOG_PORTABLE;NETSTANDARD2_0;</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LibGit2Sharp" Version="0.25.0-preview-0033" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<PackageReference Include="JetBrains.Annotations" Version="10.4.0" />
<PackageReference Include="LibGit2Sharp" Version="0.26.0-preview-0070" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<PackageReference Include="JetBrains.Annotations" Version="10.4.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="JetBrains.Annotations" Version="10.4.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.3.0" />
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
</ItemGroup>
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="4.3.0" />
</ItemGroup>
</Project>
9 changes: 3 additions & 6 deletions src/GitTools.Core/GitTools.Core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@
</dependencies>
</metadata>
<files>
<file src="net4\GitTools.Core.dll" target="lib\net4\" />
<file src="net4\GitTools.Core.pdb" target="lib\net4\" />
<file src="net4\GitTools.Core.xml" target="lib\net4\" />
<file src="net45\GitTools.Core.dll" target="lib\net45\" />
<file src="net45\GitTools.Core.pdb" target="lib\net45\" />
<file src="net45\GitTools.Core.xml" target="lib\net45\" />
<file src="net461\GitTools.Core.dll" target="lib\net461\" />
<file src="net461\GitTools.Core.pdb" target="lib\net461\" />
<file src="net461\GitTools.Core.xml" target="lib\net461\" />
</files>
</package>
6 changes: 3 additions & 3 deletions src/GitTools.Core/Helpers/ProcessHelper.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#if !NETSTANDARD1_3
#if !NETSTANDARD2_0
namespace GitTools
{
{
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Runtime.InteropServices;
using System.Threading;


public static class ProcessHelper
{
Expand Down