Skip to content

Commit

Permalink
Remove unused code branch (#2679)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjbaxter authored Dec 14, 2024
1 parent a16733a commit 16f93aa
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,10 @@ public CredentialsProvider createFor(String uri, String username, String passwor
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);
Expand Down

0 comments on commit 16f93aa

Please sign in to comment.