        }

        // map extracted credentials to CredentialItems, see also: org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider
        for (CredentialItem item : items) {
            if (item instanceof CredentialItem.Username) {
                ((CredentialItem.Username) item).setValue(credentialsPair.username);
            } else if (item instanceof CredentialItem.Password) {
                ((CredentialItem.Password) item).setValue(credentialsPair.password);
            } else if (item instanceof CredentialItem.StringType && item.getPromptText().equals("Password: ")) {
                ((CredentialItem.StringType) item).setValue(new String(credentialsPair.password));
            } else {