コード例 #1
0
        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));
            }
        }
コード例 #2
0
        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);
        }