Skip to content

Possible unused branch in GitCredentialsProviderFactory #2674

Closed
@mrclmh

Description

@mrclmh

Describe the bug
It seems the branch starting on line 99 is never executed because whenever hasText(username) is true, the branch starting on line 93 is executed.

else if (hasText(username)) {
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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions