Remove unused code branch (#2679)

This commit is contained in:
Ryan Baxter
2024-12-13 19:57:49 -05:00
committed by GitHub
parent a16733aad6
commit 16f93aa9db

View File

@@ -88,17 +88,10 @@ public class GitCredentialsProviderFactory {
aws.setPassword(password);
provider = aws;
}
else if (hasText(username)) {
else if (hasText(username) && password != null) {
this.logger.debug("Constructing UsernamePasswordCredentialsProvider for URI " + uri);
provider = new UsernamePasswordCredentialsProvider(username, password.toCharArray());
}
else if (hasText(username) && !hasText(passphrase)) {
// useful for token based login gh-1602
// see
// https://stackoverflow.com/questions/28073266/how-to-use-jgit-to-push-changes-to-remote-with-oauth-access-token
this.logger.debug("Constructing UsernamePasswordCredentialsProvider for URI " + uri);
provider = new UsernamePasswordCredentialsProvider(username, (String) null);
}
else if (hasText(passphrase)) {
this.logger.debug("Constructing PassphraseCredentialsProvider for URI " + uri);
provider = new PassphraseCredentialsProvider(passphrase);