Skip to content

Commit 11b3e12

Browse files
author
Ryan Roden-Corrent
committed
Tweak config redirection code based on PR review.
Remove comments listing unsupported libgit2_opts signatures -- these are subject to change. Instead just note that there are more signatures that could be implemented in the future. Fix some comments and names to be more accurate. Fold the libgit2_opts declarations in a code region to keep things tidy.
1 parent 3cd756e commit 11b3e12

File tree

1 file changed

+8
-15
lines changed

1 file changed

+8
-15
lines changed

LibGit2Sharp/Core/NativeMethods.cs

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -581,31 +581,24 @@ internal static extern int git_filter_unregister(
581581
[DllImport(libgit2)]
582582
internal static extern int git_libgit2_features();
583583

584+
#region git_libgit2_opts
585+
584586
// Bindings for git_libgit2_opts(int option, ...):
585587
// Varargs can be bound using __arglist in .NET, but I had trouble getting that working with Mono.
586-
// Instead of using __arglist, I enumerate the possible signatures here:
588+
// Instead of using __arglist, I enumerate the possible signatures here.
589+
// Currently only GIT_OPT_GET_SEARCH_PATH and GIT_OPT_SET_SEARCH_PATH are supported,
590+
// but other overloads could be added using a similar pattern.
587591

588592
// git_libgit2_opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)
589593
[DllImport(libgit2, CallingConvention = CallingConvention.Cdecl)]
590594
internal static extern int git_libgit2_opts(int option, uint level, GitBuf buf);
591595

592-
// git_libgit2_opts(GIT_OPT_GET_SEARCH_PATH, int level, git_buf *buf)
596+
// git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, int level, const char *path)
593597
[DllImport(libgit2, CallingConvention = CallingConvention.Cdecl)]
594598
internal static extern int git_libgit2_opts(int option, uint level,
595-
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))]string name);
599+
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier, MarshalTypeRef = typeof(StrictUtf8Marshaler))]string path);
596600

597-
// Not yet implemented libgit2_opts signatures:
598-
// git_libgit2_opts(GIT_OPT_GET_MWINDOW_SIZE, size_t*)
599-
// git_libgit2_opts(GIT_OPT_SET_MWINDOW_SIZE, size_t)
600-
// git_libgit2_opts(GIT_OPT_GET_MWINDOW_MAPPED_LIMIT, size_t*)
601-
// git_libgit2_opts(GIT_OPT_SET_MWINDOW_MAPPED_LIMIT, size_t)
602-
// git_libgit2_opts(GIT_OPT_SET_CACHE_OBJECT_LIMIT, git_otype type, size_t size)
603-
// git_libgit2_opts(GIT_OPT_SET_CACHE_MAX_SIZE, ssize_t max_storage_bytes)
604-
// git_libgit2_opts(GIT_OPT_ENABLE_CACHING, int enabled)
605-
// git_libgit2_opts(GIT_OPT_GET_CACHED_MEMORY, ssize_t* current, ssize_t* allowed)
606-
// git_libgit2_opts(GIT_OPT_GET_TEMPLATE_PATH, git_buf*out)
607-
// git_libgit2_opts(GIT_OPT_SET_TEMPLATE_PATH, const char* path)
608-
// git_libgit2_opts(GIT_OPT_SET_SSL_CERT_LOCATIONS, const char* file, const char* path)
601+
#endregion
609602

610603
[DllImport(libgit2)]
611604
internal static extern int git_graph_ahead_behind(out UIntPtr ahead, out UIntPtr behind, RepositorySafeHandle repo, ref GitOid one, ref GitOid two);

0 commit comments

Comments
 (0)