コード例 #1
0
        internal GitCredential CreateEntry(string url, string username)
        {
            GitCredential entry = gitCredentials.GetEntry(url);

            if (entry != null)
            {
                return(null);
            }
            entry = new GitCredential()
            {
                URL = url
            };
            entry.SetUsername(username);
            gitCredentials.AddEntry(entry);
            return(entry);
        }
コード例 #2
0
        internal static GitCredential CreatEntry(string url, string username, string password)
        {
            GitCredential entry = gitCredentials.GetEntry(url);

            if (entry != null)
            {
                return(null);
            }
            entry = new GitCredential()
            {
                URL = url
            };
            entry.SetUsername(username);
            gitCredentials.AddEntry(entry);
            if (!string.IsNullOrEmpty(password))
            {
                SetNewPassword(url, username, password);
            }
            return(entry);
        }