Skip to content

Commit e710875

Browse files
committed
Merge upstream/master into portable
2 parents 803e499 + aa06026 commit e710875

File tree

11 files changed

+69
-33
lines changed

11 files changed

+69
-33
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
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
@@ -30,6 +33,7 @@ script:
3033
branches:
3134
only:
3235
- master
36+
- /^maint.*/
3337
- portable
3438

3539
# Notify of build changes

CHANGES.md

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,41 @@
1010
- Windows (x86/amd64): <https://ci.appveyor.com/project/libgit2/libgit2sharp>
1111
- Linux/Mac OS X: <https://travis-ci.org/libgit2/libgit2sharp>
1212

13-
## v0.22 + 1
13+
## v0.23 + 1
1414

1515
### Additions
1616

17+
### Changes
18+
19+
### Fixes
20+
21+
## v0.23 - ([diff](https://github.com/libgit2/libgit2sharp/compare/v0.22..v0.23))
22+
23+
### Additions
24+
25+
- Add `CherryPickCommit` and `RevertCommit` to `ObjectDatabase`.
26+
- Add `IncludeIgnored` field to `SatusOptions`.
27+
- Add `Commit.CreateBuffer` to write a commit object to a buffer and
28+
`ObjectDatabase.CreateCommitWithSignature` to create commits which include a
29+
signature.
30+
- Add `Commit.ExtractSignature` to get a commit's signature.
31+
- Add `ObjectDatabase.Write<T>` to write arbitrary objects to the object db.
32+
- Add `Commit.PrettifyMessage`
33+
34+
1735
### Changes
1836

1937
- The native libraries are now expected to be in the `lib` directory,
2038
instead of `NativeBinaries` for improved mono compatibility. In
2139
addition, the names of platform architectures now better reflect
2240
the vendor naming (eg, `x86_64` instead of `amd64` on Linux).
23-
- Obsolete the config paths in RepositoryOptions
24-
25-
### Fixes
41+
- Deprecate the config paths in RepositoryOptions
42+
- Deprecate the `QueryBy` overload with `FollowFilter`.
43+
- Deprecate `Branch.Remote` in favour of `Branch.RemoteName`
44+
- `Remote` no longer implement the equality operator.
45+
- `Remote.Update` takes a remote name instead of an instance.
46+
- `Fetch`, `Pull`, `Move`, `Remove`, `Stage` are now in a commands namespace to
47+
indicate what they represent.
2648

2749
## v0.22 - ([diff](https://github.com/libgit2/libgit2sharp/compare/v0.21.1...v0.22))
2850

LibGit2Sharp.Shared/Core/GitDiff.cs

Lines changed: 1 addition & 0 deletions
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.Shared/Core/GitOdbBackend.cs

Lines changed: 1 addition & 0 deletions
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.Shared/Core/Handles/Libgit2Object.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
// Uncomment the line below or add a conditional symbol to activate this mode
77

8-
#define LEAKS_IDENTIFYING
8+
// #define LEAKS_IDENTIFYING
99

1010
// This activates a more throrough mode which will show the stack trace of the
1111
// allocation code path for each handle that has been improperly released.
@@ -15,7 +15,7 @@
1515
//
1616
// Uncomment the line below or add a conditional symbol to activate this mode
1717

18-
#define LEAKS_TRACKING
18+
// #define LEAKS_TRACKING
1919

2020
using System;
2121
using System.Linq;

LibGit2Sharp.Shared/GlobalSettings.cs

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,31 @@ static GlobalSettings()
2424
if (Platform.OperatingSystem == OperatingSystemType.Windows)
2525
{
2626
#if NET40
27-
string managedPath = Path.GetDirectoryName(new Uri(Assembly.GetExecutingAssembly().EscapedCodeBase).LocalPath);
27+
/* Assembly.CodeBase is not actually a correctly formatted
28+
* URI. It's merely prefixed with `file:///` and has its
29+
* backslashes flipped. This is superior to EscapedCodeBase,
30+
* which does not correctly escape things, and ambiguates a
31+
* space (%20) with a literal `%20` in the path. Sigh.
32+
*/
33+
var managedPath = Assembly.GetExecutingAssembly().CodeBase;
34+
if (managedPath == null)
35+
{
36+
managedPath = Assembly.GetExecutingAssembly().Location;
37+
}
38+
else if (managedPath.StartsWith("file:///"))
39+
{
40+
managedPath = managedPath.Substring(8).Replace('/', '\\');
41+
}
42+
else if (managedPath.StartsWith("file://"))
43+
{
44+
managedPath = @"\\" + managedPath.Substring(7).Replace('/', '\\');
45+
}
46+
47+
managedPath = Path.GetDirectoryName(managedPath);
2848
#else
2949
string managedPath = AppContext.BaseDirectory;
3050
#endif
51+
3152
nativeLibraryPath = Path.Combine(managedPath, "lib", "win32");
3253
}
3354

LibGit2Sharp.Tests.Shared/ConfigurationFixture.cs

Lines changed: 7 additions & 22 deletions
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.Shared/FileHistoryFixture.cs

Lines changed: 2 additions & 1 deletion
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/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"dependencies": {
3-
"LibGit2Sharp.NativeBinaries": "[1.0.160]",
3+
"LibGit2Sharp.NativeBinaries": "[1.0.164]",
44
"Nerdbank.GitVersioning": "1.5.51"
55
},
66
"frameworks": {

appveyor.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ os: Visual Studio 2015
55
branches:
66
only:
77
- master
8+
- /^maint.*/
89
- portable
910

1011
skip_tags: true
@@ -18,7 +19,7 @@ environment:
1819
secure: nuzUT+HecXGIi3KaPd/1hgFEZJan/j6+oNbPV75JKjk=
1920
coverity_email:
2021
secure: eGVilNg1Yuq+Xj+SW8r3WCtjnzhoDV0sNJkma4NRq7A=
21-
version : 0.23.0
22+
version : 0.24.0
2223
matrix:
2324
- xunit_runner: xunit.console.x86.exe
2425
Arch: 32

0 commit comments

Comments
 (0)