예제 #1
0
 public static GitCredentials ConvertToGitCredentials(this GitCredentialSettings gitCredentialSettings)
 {
     return(gitCredentialSettings.Type switch {
         CredentialType.Ssh => (GitCredentials) new SshGitCredentials(gitCredentialSettings.Ssh.PrivateKey),
         CredentialType.UsernamePassword => new UsernamePasswordGitCredentials(
             gitCredentialSettings.UsernamePassword.Username,
             gitCredentialSettings.UsernamePassword.Password
             )
     });
예제 #2
0
 public static GitCredentials ConvertToGitCredentials(this GitCredentialSettings gitCredentialSettings)
 {
     return(gitCredentialSettings.Type switch {
         CredentialType.Ssh => (GitCredentials) new SshGitCredentials(gitCredentialSettings.Ssh.PrivateKey),
         CredentialType.UsernamePassword => new UsernamePasswordGitCredentials(
             gitCredentialSettings.UsernamePassword.Username,
             gitCredentialSettings.UsernamePassword.Password
             ),
         _ => throw new ArgumentOutOfRangeException()
     });