Skip to content

Commit

Permalink
JENKINS-44640 - Fix NPE checking legacy git SCM URL
Browse files Browse the repository at this point in the history
Credential tracking is intended to track relevant and valuable use of
the credential, not something as simple as using that credential in a
form validation.

Form validation is valuable for the user experience of the
administrator, but it is not valuable enough to track the credential
use in validating the form.
  • Loading branch information
MarkEWaite committed Jun 2, 2017
1 parent a274696 commit 541c4b6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main/java/hudson/plugins/git/UserRemoteConfig.java
Expand Up @@ -187,7 +187,13 @@ public FormValidation doCheckUrl(@AncestorInPath Item item,
.getClient();
StandardCredentials credential = lookupCredentials(item, credentialsId, url);
git.addDefaultCredentials(credential);
CredentialsProvider.track(item, credential);

// Should not track credentials use in any checkURL method, rather should track
// credentials use at the point where the credential is used to perform an
// action (like poll the repository, clone the repository, publish a change
// to the repository).
//
// CredentialsProvider.track(item, credential);

// attempt to connect the provided URL
try {
Expand Down

0 comments on commit 541c4b6

Please sign in to comment.