Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 3, 2023. It is now read-only.

Commit fb978a0

Browse files
committed
Update libgit2 to bcc6229
libgit2/libgit2@36a80fd...bcc6229 fixup
1 parent 5a1fa41 commit fb978a0

21 files changed

+162
-245
lines changed
-887 KB
Binary file not shown.
-4.58 MB
Binary file not shown.
887 KB
Binary file not shown.
4.6 MB
Binary file not shown.
-678 KB
Binary file not shown.
-4.55 MB
Binary file not shown.
683 KB
Binary file not shown.
4.57 MB
Binary file not shown.

LibGit2Sharp/Core/GitMergeOpts.cs

Lines changed: 75 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,94 @@
1+
using System;
12
using System.Runtime.InteropServices;
23

34
namespace LibGit2Sharp.Core
45
{
5-
internal enum GitMergeFlags
6+
[StructLayout(LayoutKind.Sequential)]
7+
internal struct GitMergeOpts
68
{
9+
public uint Version;
10+
11+
public GitMergeTreeFlags MergeTreeFlags;
12+
713
/// <summary>
8-
/// Allow fast-forwards,
9-
/// returning immediately with the commit ID to fast-forward to.
14+
/// Similarity to consider a file renamed.
1015
/// </summary>
11-
GIT_MERGE_DEFAULT = 0,
16+
public uint RenameThreshold;
1217

1318
/// <summary>
14-
/// Do not fast-forward; perform a merge and prepare a merge result even
15-
/// if the inputs are eligible for fast-forwarding.
19+
/// Maximum similarity sources to examine (overrides
20+
/// 'merge.renameLimit' config (default 200)
1621
/// </summary>
17-
GIT_MERGE_NO_FASTFORWARD = 1,
22+
public uint TargetLimit;
1823

1924
/// <summary>
20-
/// Ensure that the inputs are eligible for fast-forwarding,
21-
/// error if a merge needs to be performed
25+
/// Pluggable similarityMetric; pass IntPtr.Zero
26+
/// to use internal metric.
2227
/// </summary>
23-
GIT_MERGE_FASTFORWARD_ONLY = 2,
28+
public IntPtr SimilarityMetric;
29+
30+
/// <summary>
31+
/// Flags for automerging content.
32+
/// </summary>
33+
public GitMergeFileFavorFlags MergeFileFavorFlags;
2434
}
2535

26-
[StructLayout(LayoutKind.Sequential)]
27-
internal struct GitMergeOpts
36+
/// <summary>
37+
/// The results of `git_merge_analysis` indicate the merge opportunities.
38+
/// </summary>
39+
internal enum GitMergeAnalysis
2840
{
29-
public uint Version;
41+
/// <summary>
42+
/// No merge is possible. (Unused.)
43+
/// </summary>
44+
GIT_MERGE_ANALYSIS_NONE = 0,
3045

31-
public GitMergeFlags MergeFlags;
32-
public GitMergeTreeOpts MergeTreeOpts;
33-
public GitCheckoutOpts CheckoutOpts;
46+
/// <summary>
47+
/// A "normal" merge; both HEAD and the given merge input have diverged
48+
/// from their common ancestor. The divergent commits must be merged.
49+
/// </summary>
50+
GIT_MERGE_ANALYSIS_NORMAL = (1 << 0),
51+
52+
/// <summary>
53+
/// All given merge inputs are reachable from HEAD, meaning the
54+
/// repository is up-to-date and no merge needs to be performed.
55+
/// </summary>
56+
GIT_MERGE_ANALYSIS_UP_TO_DATE = (1 << 1),
57+
58+
/// <summary>
59+
/// The given merge input is a fast-forward from HEAD and no merge
60+
/// needs to be performed. Instead, the client can check out the
61+
/// given merge input.
62+
/// </summary>
63+
GIT_MERGE_ANALYSIS_FASTFORWARD = (1 << 2),
64+
65+
/**
66+
* The HEAD of the current repository is "unborn" and does not point to
67+
* a valid commit. No merge can be performed, but the caller may wish
68+
* to simply set HEAD to the target commit(s).
69+
*/
70+
GIT_MERGE_ANALYSIS_UNBORN = (1 << 3),
71+
}
72+
73+
[Flags]
74+
internal enum GitMergeTreeFlags
75+
{
76+
/// <summary>
77+
/// No options.
78+
/// </summary>
79+
GIT_MERGE_TREE_NORMAL = 0,
80+
81+
/// <summary>
82+
/// GIT_MERGE_TREE_FIND_RENAMES in libgit2
83+
/// </summary>
84+
GIT_MERGE_TREE_FIND_RENAMES = (1 << 0),
85+
}
86+
87+
internal enum GitMergeFileFavorFlags
88+
{
89+
GIT_MERGE_FILE_FAVOR_NORMAL = 0,
90+
GIT_MERGE_FILE_FAVOR_OURS = 1,
91+
GIT_MERGE_FILE_FAVOR_THEIRS = 2,
92+
GIT_MERGE_FILE_FAVOR_UNION = 3,
3493
}
3594
}

LibGit2Sharp/Core/GitMergeResult.cs

Lines changed: 0 additions & 47 deletions
This file was deleted.

LibGit2Sharp/Core/GitMergeTreeOpts.cs

Lines changed: 0 additions & 57 deletions
This file was deleted.

LibGit2Sharp/Core/Handles/GitMergeResultHandle.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
namespace LibGit2Sharp.Core.Handles
22
{
3-
internal class SubmoduleSafeHandle : NotOwnedSafeHandleBase
3+
internal class SubmoduleSafeHandle : SafeHandleBase
44
{
5+
protected override bool ReleaseHandleImpl()
6+
{
7+
Proxy.git_submodule_free(handle);
8+
return true;
9+
}
510
}
611
}

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-36a80fd";
5+
public const string Name = "git2-bcc6229";
66
}
77
}

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -610,28 +610,18 @@ internal static extern int git_merge_head_from_id(
610610

611611
[DllImport(libgit2)]
612612
internal static extern int git_merge(
613-
out GitMergeResultHandle mergeResult,
614613
RepositorySafeHandle repo,
615-
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] [In] IntPtr[] their_heads,
614+
[In] IntPtr[] their_heads,
616615
UIntPtr their_heads_len,
617-
ref GitMergeOpts given_opts);
616+
ref GitMergeOpts merge_opts,
617+
ref GitCheckoutOpts checkout_opts);
618618

619619
[DllImport(libgit2)]
620-
internal static extern int git_merge_result_is_uptodate(
621-
GitMergeResultHandle merge_result);
622-
623-
[DllImport(libgit2)]
624-
internal static extern int git_merge_result_is_fastforward(
625-
GitMergeResultHandle merge_result);
626-
627-
[DllImport(libgit2)]
628-
internal static extern int git_merge_result_fastforward_id(
629-
out GitOid oid,
630-
GitMergeResultHandle merge_result);
631-
632-
[DllImport(libgit2)]
633-
internal static extern void git_merge_result_free(
634-
IntPtr merge_result);
620+
internal static extern int git_merge_analysis(
621+
out GitMergeAnalysis status_out,
622+
RepositorySafeHandle repo,
623+
[In] IntPtr[] their_heads,
624+
int their_heads_len);
635625

636626
[DllImport(libgit2)]
637627
internal static extern void git_merge_head_free(
@@ -980,11 +970,11 @@ internal static extern int git_remote_create(
980970
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string url);
981971

982972
[DllImport(libgit2)]
983-
internal static extern int git_remote_create_inmemory(
973+
internal static extern int git_remote_create_anonymous(
984974
out RemoteSafeHandle remote,
985975
RepositorySafeHandle repo,
986-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string refspec,
987-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string url);
976+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string url,
977+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))] string refspec);
988978

989979

990980
[DllImport(libgit2)]
@@ -1313,6 +1303,10 @@ internal static extern int git_submodule_add_to_index(
13131303
internal static extern int git_submodule_save(
13141304
SubmoduleSafeHandle submodule);
13151305

1306+
[DllImport(libgit2)]
1307+
internal static extern void git_submodule_free(
1308+
IntPtr submodule);
1309+
13161310
[DllImport(libgit2)]
13171311
[return: MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
13181312
internal static extern string git_submodule_path(
@@ -1349,7 +1343,8 @@ internal static extern bool git_submodule_fetch_recurse_submodules(
13491343

13501344
[DllImport(libgit2)]
13511345
internal static extern int git_submodule_reload(
1352-
SubmoduleSafeHandle submodule);
1346+
SubmoduleSafeHandle submodule,
1347+
[MarshalAs(UnmanagedType.Bool)] bool force);
13531348

13541349
[DllImport(libgit2)]
13551350
internal static extern int git_submodule_status(

0 commit comments

Comments
 (0)