8000 Update libgit2 binaries to 11f8336 · philhack/libgit2sharp@7b70423 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7b70423

Browse files
committed
Update libgit2 binaries to 11f8336
libgit2/libgit2@32e4992...11f8336
1 parent d54f395 commit 7b70423

25 files changed

+95
-25
lines changed
796 KB
Binary file not shown.
-787 KB
Binary file not shown.
601 KB
Binary file not shown.
-591 KB
Binary file not shown.

LibGit2Sharp.Tests/CheckoutFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,9 @@ public void CheckingOutAgainstAnUnbornBranchThrows()
361361

362362
using (var repo = new Repository(repoPath))
363363
{
364-
Assert.True(repo.Info.IsHeadOrphaned);
364+
Assert.True(repo.Info.IsHeadUnborn);
365365

366-
Assert.Throws<OrphanedHeadException>(() => repo.Checkout(repo.Head));
366+
Assert.Throws<UnbornBranchException>(() => repo.Checkout(repo.Head));
367367
}
368368
}
369369

LibGit2Sharp.Tests/CommitFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ public void CanCommitALittleBit()
640640
AssertBlobContent(commit[relativeFilepath], "nulltoken\n");
641641

642642
Assert.Equal(0, commit.Parents.Count());
643-
Assert.False(repo.Info.IsHeadOrphaned);
643+
Assert.False(repo.Info.IsHeadUnborn);
644644

645645
// Assert a reflog entry is created on HEAD
646646
Assert.Equal(1, repo.Refs.Log("HEAD").Count());
@@ -804,7 +804,7 @@ public void CanNotAmendAnEmptyRepository()
804804

805805
using (var repo = new Repository(repoPath))
806806
{
807-
Assert.Throws<OrphanedHeadException>(() => repo.Commit("I can not amend anything !:(", Constants.Signature, Constants.Signature, true));
807+
Assert.Throws<UnbornBranchException>(() => repo.Commit("I can not amend anything !:(", Constants.Signature, Constants.Signature, true));
808808
}
809809
}
810810

LibGit2Sharp.Tests/RepositoryFixture.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ private static void AssertInitializedRepository(Repository repo, string expected
228228
{
229229
Assert.NotNull(repo.Info.Path);
230230
Assert.False(repo.Info.IsHeadDetached);
231-
Assert.True(repo.Info.IsHeadOrphaned);
231+
Assert.True(repo.Info.IsHeadUnborn);
232232

233233
Reference headRef = repo.Refs.Head;
234234
Assert.NotNull(headRef);
@@ -541,13 +541,13 @@ public void CanDetectIfTheHeadIsOrphaned()
541541
{
542542
string branchName = repo.Head.CanonicalName;
543543

544-
Assert.False(repo.Info.IsHeadOrphaned);
544+
Assert.False(repo.Info.IsHeadUnborn);
545545

546546
repo.Refs.Add("HEAD", "refs/heads/orphan", true);
547-
Assert.True(repo.Info.IsHeadOrphaned);
547+
Assert.True(repo.Info.IsHeadUnborn);
548548

549549
repo.Refs.Add("HEAD", branchName, true);
550-
Assert.False(repo.Info.IsHeadOrphaned);
550+
Assert.False(repo.Info.IsHeadUnborn);
551551
}
552552
}
553553

LibGit2Sharp.Tests/TagFixture.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,7 @@ public void CanListAllTagsInAEmptyRepository()
602602

603603
using (var repo = new Repository(repoPath))
604604
{
605-
Assert.True(repo.Info.IsHeadOrphaned);
605+
Assert.True(repo.Info.IsHeadUnborn);
606606
Assert.Equal(0, repo.Tags.Count());
607607
}
608608
}

LibGit2Sharp.Tests/UnstageFixture.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public void UnstagingUnknownPathsAgainstAnOrphanedHeadWithStrictUnmatchedExplici
162162
using (var repo = new Repository(CloneStandardTestRepo()))
163163
{
164164
repo.Refs.UpdateTarget("HEAD", "refs/heads/orphaned");
165-
Assert.True(repo.Info.IsHeadOrphaned);
165+
Assert.True(repo.Info.IsHeadUnborn);
166166

167167
Assert.Equal(currentStatus, repo.Index.RetrieveStatus(relativePath));
168168

@@ -178,7 +178,7 @@ public void CanUnstageUnknownPathsAgainstAnOrphanedHeadWithLaxUnmatchedExplicitP
178178
using (var repo = new Repository(CloneStandardTestRepo()))
179179
{
180180
repo.Refs.UpdateTarget("HEAD", "refs/heads/orphaned");
181-
Assert.True(repo.Info.IsHeadOrphaned);
181+
Assert.True(repo.Info.IsHeadUnborn);
182182

183183
Assert.Equal(currentStatus, repo.Index.RetrieveStatus(relativePath));
184184

LibGit2Sharp/Core/GitCloneOptions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ internal class GitCloneOptions
99
public uint Version = 1;
1010

1111
public GitCheckoutOpts CheckoutOpts;
12+
public IntPtr InitOptions;
1213
public int Bare;
1314
public NativeMethods.git_transfer_progress_callback TransferProgressCallback;
1415
public IntPtr TransferProgressPayload;

LibGit2Sharp/Core/GitErrorCategory.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,9 @@ internal enum GitErrorCategory
2323
Thread,
2424
Stash,
2525
Checkout,
26+
FetchHead,
27+
Merge,
28+
Ssh,
29+
Filter,
2630
}
2731
}

LibGit2Sharp/Core/GitOdbBackendStream.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ static GitOdbBackendStream()
2222
public GitOdbBackendStreamMode Mode;
2323
public IntPtr HashCtx;
2424

25+
public UIntPtr DeclaredSize;
26+
public UIntPtr ReceivedBytes;
27+
2528
public read_callback Read;
2629
public write_callback Write;
2730
public finalize_write_callback FinalizeWrite;

LibGit2Sharp/Core/NativeDllName.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ namespace LibGit2Sharp.Core
22
{
33
internal static class NativeDllName
44
{
5-
public const string Name = "git2-32e4992";
5+
public const string Name = "git2-11f8336";
66
}
77
}

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ internal static extern int git_repository_fetchhead_foreach(
879879
internal static extern int git_repository_head_detached(RepositorySafeHandle repo);
880880

881881
[DllImport(libgit2)]
882-
internal static extern int git_repository_head_orphan(RepositorySafeHandle repo);
882+
internal static extern int git_repository_head_unborn(RepositorySafeHandle repo);
883883

884884
[DllImport(libgit2)]
885885
internal static extern int git_repository_index(out IndexSafeHandle index, RepositorySafeHandle repo);

LibGit2Sharp/Core/Proxy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,9 +1556,9 @@ public static void git_repository_free(IntPtr repo)
15561556
NativeMethods.git_repository_free(repo);
15571557
}
15581558

1559-
public static bool git_repository_head_orphan(RepositorySafeHandle repo)
1559+
public static bool git_repository_head_unborn(RepositorySafeHandle repo)
15601560
{
1561-
return RepositoryStateChecker(repo, NativeMethods.git_repository_head_orphan);
1561+
return RepositoryStateChecker(repo, NativeMethods.git_repository_head_unborn);
15621562
}
15631563

15641564
public static IndexSafeHandle git_repository_index(RepositorySafeHandle repo)

LibGit2Sharp/Index.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public virtual void Unstage(IEnumerable<string> paths, ExplicitPathsOptions expl
212212
{
213213
Ensure.ArgumentNotNull(paths, "paths");
214214

215-
if (repo.Info.IsHeadOrphaned)
215+
if (repo.Info.IsHeadUnborn)
216216
{
217217
var compareOptions = new CompareOptions { SkipPatchBuilding = true };
218218
TreeChanges changes = repo.Diff.Compare(null, DiffTargets.Index, paths, explicitPathsOptions, compareOptions);

LibGit2Sharp/LibGit2Sharp.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
<Compile Include="CommitFilter.cs" />
7373
<Compile Include="CommitSortStrategies.cs" />
7474
<Compile Include="CompareOptions.cs" />
75+
<Compile Include="UnbornBranchException.cs" />
7576
<Compile Include="LockedFileException.cs" />
7677
<Compile Include="Core\GitRepositoryInitOptions.cs" />
7778
<Compile Include="Core\HistoryRewriter.cs" />

LibGit2Sharp/OrphanedHeadException.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ namespace LibGit2Sharp
88
/// branch is performed against an unborn branch.
99
/// </summary>
1010
[Serializable]
11-
public class OrphanedHeadException : LibGit2SharpException
11+
[Obsolete("This type will be removed in the next release. Please use UnbornBranchException instead.")]
12+
public class OrphanedHeadException : UnbornBranchException
1213
{
1314
/// <summary>
1415
/// Initializes a new instance of the <see cref="OrphanedHeadException"/> class.

LibGit2Sharp/Repository.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ public Branch Checkout(Branch branch, CheckoutModifiers checkoutModifiers, Check
665665
// Make sure this is not an unborn branch.
666666
if (branch.Tip == null)
667667
{
668-
throw new OrphanedHeadException(
668+
throw new UnbornBranchException(
669669
string.Format(CultureInfo.InvariantCulture,
670670
"The tip of branch '{0}' is null. There's nothing to checkout.", branch.Name));
671671
}
@@ -865,11 +865,11 @@ public void Reset(Commit commit, IEnumerable<string> paths = null, ExplicitPaths
865865
/// <returns>The generated <see cref="Commit"/>.</returns>
866866
public Commit Commit(string message, Signature author, Signature committer, bool amendPreviousCommit = false)
867867
{
868-
bool isHeadOrphaned = Info.IsHeadOrphaned;
868+
bool isHeadOrphaned = Info.IsHeadUnborn;
869869

870870
if (amendPreviousCommit && isHeadOrphaned)
871871
{
872-
throw new OrphanedHeadException("Can not amend anything. The Head doesn't point at any commit.");
872+
throw new UnbornBranchException("Can not amend anything. The Head doesn't point at any commit.");
873873
}
874874

875875
var treeId = Proxy.git_tree_create_fromindex(Index);
@@ -925,7 +925,7 @@ private IEnumerable<Commit> RetrieveParentsOfTheCommitBeingCreated(bool amendPre
925925
return Head.Tip.Parents;
926926
}
927927

928-
if (Info.IsHeadOrphaned)
928+
if (Info.IsHeadUnborn)
929929
{
930930
return Enumerable.Empty<Commit>();
931931
}

LibGit2Sharp/RepositoryInformation.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using LibGit2Sharp.Core;
1+
using System;
2+
using LibGit2Sharp.Core;
23

34
namespace LibGit2Sharp
45
{
@@ -62,9 +63,19 @@ public virtual bool IsHeadDetached
6263
/// <summary>
6364
/// Indicates whether the Head points to a reference which doesn't exist.
6465
/// </summary>
66+
[Obsolete("This property will be removed in the next release. Please use IsHeadUnborn instead.")]
6567
public virtual bool IsHeadOrphaned
6668
{ B41A
67-
get { return Proxy.git_repository_head_orphan(repo.Handle); }
69+
get { return IsHeadUnborn; }
70+
}
71+
72+
73+
/// <summary>
74+
/// Indicates whether the Head points to a reference which doesn't exist.
75+
/// </summary>
76+
public virtual bool IsHeadUnborn
77+
{
78+
get { return Proxy.git_repository_head_unborn(repo.Handle); }
6879
}
6980

7081
/// <summary>

LibGit2Sharp/UnbornBranchException.cs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
using System;
2+
using System.Runtime.Serialization;
3+
4+
namespace LibGit2Sharp
5+
{
6+
/// <summary>
7+
/// The exception that is thrown when a operation requiring an existing
8+
/// branch is performed against an unborn branch.
9+
/// </summary>
10+
[Serializable]
11+
public class UnbornBranchException : LibGit2SharpException
12+
{
13+
/// <summary>
14+
/// Initializes a new instance of the <see cref="OrphanedHeadException"/> class.
15+
/// </summary>
16+
public UnbornBranchException()
17+
{
18+
}
19+
20+
/// <summary>
21+
/// Initializes a new instance of the <see cref="UnbornBranchException"/> class with a specified error message.
22+
/// </summary>
23+
/// <param name="message">A message that describes the error.</param>
24+
public UnbornBranchException(string message)
25+
: base(message)
26+
{
27+
}
28+
29+
/// <summary>
30+
/// Initializes a new instance of the <see cref="UnbornBranchException"/> class with a specified error message and a reference to the inner exception that is the cause of this exception.
31+
/// </summary>
32+
/// <param name="message">The error message that explains the reason for the exception.</param>
33+
/// <param name="innerException">The exception that is the cause of the current exception. If the <paramref name="innerException"/> parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.</param>
34+
public UnbornBranchException(string message, Exception innerException)
35+
: base(message, innerException)
36+
{
37+
}
38+
39+
/// <summary>
40+
/// Initializes a new instance of the <see cref="UnbornBranchException"/> class with a serialized data.
41+
/// </summary>
42+
/// <param name="info">The <see cref="SerializationInfo "/> that holds the serialized object data about the exception being thrown.</param>
43+
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
44+
protected UnbornBranchException(SerializationInfo info, StreamingContext context)
45+
: base(info, context)
46+
{
47+
}
48+
}
49+
}

LibGit2Sharp/libgit2_hash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
32e49929725a76d9871038f30e2ea67fe0e4a4f8
1+
11f8336ec93ea3a270c9fe80c4bbb68aa4729423

libgit2

Submodule libgit2 updated 140 files

0 commit comments

Comments
 (0)
0