Skip to content

Commit c0cf832

Browse files
committed
Merge remote-tracking branch 'upstream/master' into portable
2 parents 61372a7 + 3f9b415 commit c0cf832

20 files changed

+371
-53
lines changed

LibGit2Sharp.Shared/Commands/Checkout.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,14 @@ public static Branch Checkout(IRepository repository, string committishOrBranchS
4040
Reference reference;
4141
GitObject obj;
4242

43-
Console.WriteLine("revparsing {0}", committishOrBranchSpec);
4443
repository.RevParse(committishOrBranchSpec, out reference, out obj);
45-
Console.WriteLine("grabbed ref {0}, obj {1}", reference, obj);
4644
if (reference != null && reference.IsLocalBranch)
4745
{
4846
Branch branch = repository.Branches[reference.CanonicalName];
49-
Console.WriteLine("grabbed branch {0}", branch);
5047
return Checkout(repository, branch, options);
5148
}
5249

5350
Commit commit = obj.DereferenceToCommit(true);
54-
Console.WriteLine("dereferenced to commit {0}", commit);
5551
Checkout(repository, commit.Tree, options, committishOrBranchSpec);
5652

5753
return repository.Head;
@@ -92,7 +88,6 @@ public static Branch Checkout(IRepository repository, Branch branch, CheckoutOpt
9288
branch.FriendlyName);
9389
}
9490

95-
Console.WriteLine("branch: {0}", branch);
9691
if (!branch.IsRemote && !(branch is DetachedHead) &&
9792
string.Equals(repository.Refs[branch.CanonicalName].TargetIdentifier, branch.Tip.Id.Sha,
9893
StringComparison.OrdinalIgnoreCase))

LibGit2Sharp.Shared/Commands/Fetch.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public static void Fetch(Repository repository, string remote, IEnumerable<strin
7171
fetchOptions.Prune = FetchPruneStrategy.FromConfigurationOrDefault;
7272
}
7373

74+
fetchOptions.ProxyOptions = new GitProxyOptions { Version = 1 };
75+
7476
Proxy.git_remote_fetch(remoteHandle, refspecs, fetchOptions, logMessage);
7577
}
7678

LibGit2Sharp.Shared/Core/GitCloneOptions.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ internal struct GitCloneOptions
2323
public GitCloneLocal Local;
2424
public IntPtr CheckoutBranch;
2525

26-
public IntPtr signature; // Really a SignatureSafeHandle
27-
2826
public IntPtr RepositoryCb;
2927
public IntPtr RepositoryCbPayload;
3028

LibGit2Sharp.Shared/Core/GitDiff.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ internal unsafe struct git_diff_file
249249
public Int64 Size;
250250
public GitDiffFlags Flags;
251251
public UInt16 Mode;
252+
public UInt16 IdAbbrev;
252253
}
253254

254255
[StructLayout(LayoutKind.Sequential)]

LibGit2Sharp.Shared/Core/GitErrorCategory.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,6 @@ internal enum GitErrorCategory
3434
Describe,
3535
Rebase,
3636
Filesystem,
37+
Patch
3738
}
3839
}

LibGit2Sharp.Shared/Core/GitFetchOptions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ internal class GitFetchOptions
1010
public FetchPruneStrategy Prune;
1111
public bool UpdateFetchHead = true;
1212
public TagFetchMode download_tags;
13+
public GitProxyOptions ProxyOptions;
1314
public GitStrArrayManaged custom_headers;
1415
}
1516
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using System;
2+
using System.Runtime.InteropServices;
3+
4+
namespace LibGit2Sharp.Core
5+
{
6+
internal enum GitProxyType
7+
{
8+
None,
9+
Auto,
10+
Specified
11+
}
12+
13+
[StructLayout(LayoutKind.Sequential)]
14+
internal struct GitProxyOptions
15+
{
16+
public uint Version;
17+
public GitProxyType Type;
18+
public IntPtr Url;
19+
public IntPtr CredentialsCb;
20+
public IntPtr CertificateCheck;
21+
public IntPtr CbPayload;
22+
}
23+
}

LibGit2Sharp.Shared/Core/GitPushOptions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ internal class GitPushOptions
88
public int Version = 1;
99
public int PackbuilderDegreeOfParallelism;
1010
public GitRemoteCallbacks RemoteCallbacks;
11+
public GitProxyOptions ProxyOptions;
1112
public GitStrArrayManaged CustomHeaders;
1213
}
1314
}

LibGit2Sharp.Shared/Core/GitSubmoduleOptions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace LibGit2Sharp.Core
44
{
55
[StructLayout(LayoutKind.Sequential)]
6-
internal struct GitSubmoduleOptions
6+
internal struct GitSubmoduleUpdateOptions
77
{
88
public uint Version;
99

@@ -12,5 +12,7 @@ internal struct GitSubmoduleOptions
1212
public GitFetchOptions FetchOptions;
1313

1414
public CheckoutStrategy CloneCheckoutStrategy;
15+
16+
public int AllowFetch;
1517
}
1618
}

LibGit2Sharp.Shared/Core/NativeMethods.cs

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,6 @@ private static extern unsafe int git_blob_create_fromworkdir(
131131
git_repository* repo,
132132
[CustomMarshaler(typeof(StrictFilePathMarshaler), typeof(FilePath))] byte* relative_path);
133133

134-
internal delegate int source_callback(
135-
IntPtr content,
136-
int max_length,
137-
IntPtr data);
138-
139134
[DllImport(libgit2)]
140135
private static extern unsafe int git_blob_create_fromstream(
141136
out IntPtr stream,
@@ -147,14 +142,6 @@ internal static extern unsafe int git_blob_create_fromstream_commit(
147142
ref GitOid oid,
148143
IntPtr stream);
149144

150-
[DllImport(libgit2)]
151-
private static extern unsafe int git_blob_create_fromchunks(
152-
ref GitOid oid,
153-
git_repository* repositoryPtr,
154-
[CustomMarshaler(typeof(StrictFilePathMarshaler), typeof(FilePath))] byte* hintpath,
155-
source_callback fileCallback,
156-
IntPtr data);
157-
158145
[DllImport(libgit2)]
159146
private static extern unsafe int git_blob_filtered_content(
160147
GitBuf buf,
@@ -1029,7 +1016,7 @@ internal static extern unsafe int git_packbuilder_insert_tree(
10291016
internal static extern unsafe int git_packbuilder_new(out git_packbuilder* packbuilder, git_repository* repo);
10301017

10311018
[DllImport(libgit2)]
1032-
internal static extern unsafe UInt32 git_packbuilder_object_count(git_packbuilder* packbuilder);
1019+
internal static extern unsafe UIntPtr git_packbuilder_object_count(git_packbuilder* packbuilder);
10331020

10341021
[DllImport(libgit2)]
10351022
internal static extern unsafe UInt32 git_packbuilder_set_threads(git_packbuilder* packbuilder, UInt32 numThreads);
@@ -1043,7 +1030,7 @@ private static extern unsafe int git_packbuilder_write(
10431030
IntPtr payload);
10441031

10451032
[DllImport(libgit2)]
1046-
internal static extern unsafe UInt32 git_packbuilder_written(git_packbuilder* packbuilder);
1033+
internal static extern unsafe UIntPtr git_packbuilder_written(git_packbuilder* packbuilder);
10471034

10481035
[DllImport(libgit2)]
10491036
private static extern unsafe int git_reference_create(
@@ -1222,6 +1209,7 @@ internal static extern unsafe int git_remote_connect(
12221209
git_remote* remote,
12231210
GitDirection direction,
12241211
ref GitRemoteCallbacks callbacks,
1212+
ref GitProxyOptions proxy_options,
12251213
ref GitStrArray custom_headers);
12261214

12271215
[DllImport(libgit2)]
@@ -1512,6 +1500,15 @@ internal static extern unsafe int git_revert(
15121500
git_object* commit,
15131501
GitRevertOpts opts);
15141502

1503+
[DllImport(libgit2)]
1504+
internal static extern unsafe int git_revert_commit(
1505+
out git_index* index,
1506+
git_repository* repo,
1507+
git_object* revert_commit,
1508+
git_object* our_commit,
1509+
uint mainline,
1510+
ref GitMergeOpts opts);
1511+
15151512
[DllImport(libgit2)]
15161513
private static extern unsafe int git_revparse_ext(
15171514
out git_object* obj,
@@ -1644,7 +1641,7 @@ private static extern unsafe int git_submodule_resolve_url(
16441641
internal static extern unsafe int git_submodule_update(
16451642
git_submodule* sm,
16461643
[MarshalAs(UnmanagedType.Bool)] bool init,
1647-
ref GitSubmoduleOptions submoduleUpdateOptions);
1644+
ref GitSubmoduleUpdateOptions submoduleUpdateOptions);
16481645

16491646
internal delegate int submodule_callback(
16501647
IntPtr sm,
@@ -1871,6 +1868,14 @@ private static extern unsafe int git_treebuilder_insert(
18711868
[DllImport(libgit2)]
18721869
internal static extern unsafe int git_cherrypick(git_repository* repo, git_object* commit, GitCherryPickOptions options);
18731870

1871+
[DllImport(libgit2)]
1872+
internal static extern unsafe int git_cherrypick_commit(out git_index* index,
1873+
git_repository* repo,
1874+
git_object* cherrypick_commit,
1875+
git_object* our_commit,
1876+
uint mainline,
1877+
ref GitMergeOpts options);
1878+
18741879
[DllImport(libgit2)]
18751880
internal static extern int git_transaction_commit(IntPtr txn);
18761881

0 commit comments

Comments
 (0)