Skip to content

Update to 75db289a (v0.25) #1394

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Dec 23, 2016
Merged
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
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 7 additions & 22 deletions LibGit2Sharp.Tests/ConfigurationFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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]
Expand All @@ -497,7 +482,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);
Expand Down
3 changes: 2 additions & 1 deletion LibGit2Sharp.Tests/FileHistoryFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
1 change: 1 addition & 0 deletions LibGit2Sharp/Core/GitDiff.cs
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ internal class GitDiffBinaryFile
[StructLayout(LayoutKind.Sequential)]
internal class GitDiffBinary
{
public uint ContainsData;
public GitDiffBinaryFile OldFile;
public GitDiffBinaryFile NewFile;
}
Expand Down
1 change: 1 addition & 0 deletions LibGit2Sharp/Core/GitOdbBackend.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
18 changes: 9 additions & 9 deletions LibGit2Sharp/LibGit2Sharp.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props')" />
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.163\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.163\build\LibGit2Sharp.NativeBinaries.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -366,11 +366,11 @@
</ItemGroup>
<ItemGroup>
<None Include="libgit2sharp.snk" />
<None Include="packages.config" />
<None Include="Core\Handles\Objects.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>Objects.cs</LastGenOutput>
</None>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="UniqueIdentifier.targets" />
Expand All @@ -380,12 +380,6 @@
<PreBuildEvent>
</PreBuildEvent>
</PropertyGroup>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props'))" />
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
Expand All @@ -394,4 +388,10 @@
</Target>
-->
<ItemGroup />
</Project>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.163\build\LibGit2Sharp.NativeBinaries.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\LibGit2Sharp.NativeBinaries.1.0.163\build\LibGit2Sharp.NativeBinaries.props'))" />
</Target>
</Project>
4 changes: 2 additions & 2 deletions LibGit2Sharp/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LibGit2Sharp.NativeBinaries" version="1.0.160" targetFramework="net4" allowedVersions="[1.0.160]" />
</packages>
<package id="LibGit2Sharp.NativeBinaries" version="1.0.163" targetFramework="net40" allowedVersions="[1.0.163]" />
</packages>