public unsafe static string GetSearchPath(ConfigurationLevel level) { GitBuffer buf = new GitBuffer(); git_buf nativeBuffer = buf.NativeBuffer; Ensure.NativeSuccess(libgit2.git_libgit2_opts(git_libgit2_opt_t.GIT_OPT_GET_SEARCH_PATH, (git_config_level_t)level, nativeBuffer)); fixed(byte *bp = buf.Content) { return(Utf8Converter.FromNative(bp)); } }
public unsafe GitBuffer GetFilteredContent(string path, BlobFilterOptions options) { Ensure.ArgumentNotNull(path, "path"); Ensure.ArgumentNotNull(options, "options"); GitBuffer buf = new GitBuffer(); git_buf nativeBuffer = buf.NativeBuffer; Ensure.NativeSuccess(() => { git_blob_filter_options nativeOptions = options.ToNative(); return(libgit2.git_blob_filter(nativeBuffer, NativeBlob, path, &nativeOptions)); }, this); return(buf); }