Пример #1
0
        internal GitRemoteCallbacks GenerateCallbacks()
        {
            var callbacks = new GitRemoteCallbacks {version = 1};

            if (Progress != null)
            {
                callbacks.progress = GitProgressHandler;
            }

            if (UpdateTips != null)
            {
                callbacks.update_tips = GitUpdateTipsHandler;
            }

            if (CredentialsProvider != null)
            {
                callbacks.acquire_credentials = GitCredentialHandler;
            }

            if (DownloadTransferProgress != null)
            {
                callbacks.download_progress = GitDownloadTransferProgressHandler;
            }

            return callbacks;
        }
Пример #2
0
        internal GitRemoteCallbacks GenerateCallbacks()
        {
            GitRemoteCallbacks callbacks = new GitRemoteCallbacks {version = 1};

            if (Progress != null)
            {
                callbacks.progress = GitProgressHandler;
            }

            if (UpdateTips != null)
            {
                callbacks.update_tips = GitUpdateTipsHandler;
            }

            if (Completion != null)
            {
                callbacks.completion = GitCompletionHandler;
            }

            return callbacks;
        }
Пример #3
0
        internal unsafe GitRemoteCallbacks GenerateCallbacks()
        {
            var callbacks = new GitRemoteCallbacks { version = 1 };

            if (Progress != null)
            {
                callbacks.progress = GitProgressHandler;
            }

            if (UpdateTips != null)
            {
                callbacks.update_tips = GitUpdateTipsHandler;
            }

            if (PushStatusError != null)
            {
                callbacks.push_update_reference = GitPushUpdateReference;
            }

            if (CredentialsProvider != null)
            {
                callbacks.acquire_credentials = GitCredentialHandler;
            }

            if (CertificateCheck != null)
            {
                callbacks.certificate_check = GitCertificateCheck;
            }

            if (DownloadTransferProgress != null)
            {
                callbacks.download_progress = GitDownloadTransferProgressHandler;
            }

            if (PushTransferProgress != null)
            {
                callbacks.push_transfer_progress = GitPushTransferProgressHandler;
            }

            if (PackBuilderProgress != null)
            {
                callbacks.pack_progress = GitPackbuilderProgressHandler;
            }

            if (PrePushCallback != null)
            {
                callbacks.push_negotiation = GitPushNegotiationHandler;
            }

            return callbacks;
        }
Пример #4
0
        private IEnumerable<Reference> ListReferencesInternal(string url, CredentialsHandler credentialsProvider)
        {
            using (RemoteHandle remoteHandle = BuildRemoteHandle(repository.Handle, url))
            {
                GitRemoteCallbacks gitCallbacks = new GitRemoteCallbacks { version = 1 };
                GitProxyOptions proxyOptions = new GitProxyOptions { Version = 1 };

                if (credentialsProvider != null)
                {
                    var callbacks = new RemoteCallbacks(credentialsProvider);
                    gitCallbacks = callbacks.GenerateCallbacks();
                }

                Proxy.git_remote_connect(remoteHandle, GitDirection.Fetch, ref gitCallbacks, ref proxyOptions);
                return Proxy.git_remote_ls(repository, remoteHandle);
            }
        }
Пример #5
0
 internal static extern int git_remote_set_callbacks(
     RemoteSafeHandle remote,
     ref GitRemoteCallbacks callbacks);