Skip to content

Commit 17e5d81

Browse files
authored
Merge pull request #1394 from libgit2/cmn/update-75db289a
Update to 75db289a (v0.25)
2 parents 38f046d + 2504d77 commit 17e5d81

File tree

7 files changed

+25
-34
lines changed

7 files changed

+25
-34
lines changed

.travis.yml

+3
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ os:
1010
- osx
1111
- linux
1212

13+
# The newer image cannot find mono 3.12 in the PATH
14+
osx_image: xcode6.4
15+
1316
env:
1417
global:
1518
- MONO_OPTIONS=--debug

LibGit2Sharp.Tests/ConfigurationFixture.cs

+7-22
Original file line numberDiff line numberDiff line change
@@ -455,15 +455,6 @@ public void CanSetAndGetMultipleSearchPaths()
455455
[Fact]
456456
public void CanResetSearchPaths()
457457
{
458-
// all of these calls should reset the config path to the default
459-
Action[] resetActions =
460-
{
461-
() => GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global),
462-
() => GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, null),
463-
() => GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, string.Empty),
464-
() => GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, new string[] { }),
465-
};
466-
467458
// record the default search path
468459
GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, null);
469460
var oldPaths = GlobalSettings.GetConfigSearchPaths(ConfigurationLevel.Global);
@@ -472,19 +463,13 @@ public void CanResetSearchPaths()
472463
// generate a non-default path to set
473464
var newPaths = new string[] { Path.Combine(Constants.TemporaryReposPath, Path.GetRandomFileName()) };
474465

475-
foreach (var tryToReset in resetActions)
476-
{
477-
// change to the non-default path
478-
GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, newPaths);
479-
Assert.Equal(newPaths, GlobalSettings.GetConfigSearchPaths(ConfigurationLevel.Global));
480-
481-
// set it back to the default
482-
tryToReset();
483-
Assert.Equal(oldPaths, GlobalSettings.GetConfigSearchPaths(ConfigurationLevel.Global));
484-
}
466+
// change to the non-default path
467+
GlobalSettings.SetConfigSearchPaths (ConfigurationLevel.Global, newPaths);
468+
Assert.Equal (newPaths, GlobalSettings.GetConfigSearchPaths (ConfigurationLevel.Global));
485469

486-
// make sure the config paths are reset after the test ends
487-
GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, null);
470+
// set it back to the default
471+
GlobalSettings.SetConfigSearchPaths (ConfigurationLevel.Global, null);
472+
Assert.Equal (oldPaths, GlobalSettings.GetConfigSearchPaths (ConfigurationLevel.Global));
488473
}
489474

490475
[Fact]
@@ -497,7 +482,7 @@ public void CanAppendToSearchPaths()
497482
GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, "$PATH", appendMe);
498483

499484
var currentPaths = GlobalSettings.GetConfigSearchPaths(ConfigurationLevel.Global);
500-
Assert.Equal(currentPaths, prevPaths.Concat(new[] { appendMe }));
485+
Assert.Equal(prevPaths.Concat(new[] { appendMe }), currentPaths);
501486

502487
// set it back to the default
503488
GlobalSettings.SetConfigSearchPaths(ConfigurationLevel.Global, null);

LibGit2Sharp.Tests/FileHistoryFixture.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,8 @@ public void CanTellComplexCommitHistory()
161161
var commit4 = MakeAndCommitChange(repo, repoPath, newPath1, "I have done it again!");
162162

163163
// Perform tests.
164-
var fileHistoryEntries = repo.Commits.QueryBy(newPath1).ToList();
164+
var commitFilter = new CommitFilter () { SortBy = CommitSortStrategies.Topological };
165+
var fileHistoryEntries = repo.Commits.QueryBy(newPath1, commitFilter).ToList();
165166
var changedBlobs = fileHistoryEntries.Blobs().Distinct().ToList();
166167

167168
Assert.Equal(4, fileHistoryEntries.Count());

LibGit2Sharp/Core/GitDiff.cs

+1
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,7 @@ internal class GitDiffBinaryFile
397397
[StructLayout(LayoutKind.Sequential)]
398398
internal class GitDiffBinary
399399
{
400+
public uint ContainsData;
400401
public GitDiffBinaryFile OldFile;
401402
public GitDiffBinaryFile NewFile;
402403
}

LibGit2Sharp/Core/GitOdbBackend.cs

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ static GitOdbBackend()
3434
public IntPtr Refresh;
3535
public foreach_callback Foreach;
3636
public IntPtr Writepack;
37+
public IntPtr Freshen;
3738
public free_callback Free;
3839

3940
/* The libgit2 structure definition ends here. Subsequent fields are for libgit2sharp bookkeeping. */

LibGit2Sharp/LibGit2Sharp.csproj

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.160\build\LibGit2Sharp.NativeBinaries.props')" />
3+
<Import Project="..\packages\LibGit2Sharp.NativeBinaries.1.0.163\build\LibGit2Sharp.NativeBinaries.props" Condition="Exists('..\packages\LibGit2Sharp.NativeBinaries.1.0.163\build\LibGit2Sharp.NativeBinaries.props')" />
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -366,11 +366,11 @@
366366
</ItemGroup>
367367
<ItemGroup>
368368
<None Include="libgit2sharp.snk" />
369-
<None Include="packages.config" />
370369
<None Include="Core\Handles\Objects.tt">
371370
<Generator>TextTemplatingFileGenerator</Generator>
372371
<LastGenOutput>Objects.cs</LastGenOutput>
373372
</None>
373+
<None Include="packages.config" />
374374
</ItemGroup>
375375
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
376376
<Import Project="UniqueIdentifier.targets" />
@@ -380,12 +380,6 @@
380380
<PreBuildEvent>
381381
</PreBuildEvent>
382382
</PropertyGroup>
383-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
384-
<PropertyGroup>
385-
<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>
386-
</PropertyGroup>
387-
<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'))" />
388-
</Target>
389383
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
390384
Other similar extension points exist, see Microsoft.Common.targets.
391385
<Target Name="BeforeBuild">
@@ -394,4 +388,10 @@
394388
</Target>
395389
-->
396390
<ItemGroup />
397-
</Project>
391+
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
392+
<PropertyGroup>
393+
<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>
394+
</PropertyGroup>
395+
<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'))" />
396+
</Target>
397+
</Project>

LibGit2Sharp/packages.config

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="LibGit2Sharp.NativeBinaries" version="1.0.160" targetFramework="net4" allowedVersions="[1.0.160]" />
4-
</packages>
3+
<package id="LibGit2Sharp.NativeBinaries" version="1.0.163" targetFramework="net40" allowedVersions="[1.0.163]" />
4+
</packages>

0 commit comments

Comments
 (0)