Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #135 from thomasgl-orange/fix-migrateCredentials-C…
…lassCastException

[JENKINS-30197] ClassCastException when migrating credentials
  • Loading branch information
recena committed Aug 29, 2015
2 parents ab24371 + 4adfbde commit 606d958
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main/java/hudson/scm/SubversionSCM.java
Expand Up @@ -1667,8 +1667,10 @@ public void load() {
File jobCredentials = new File(job.getRootDir(), "subversion.credentials");
if (jobCredentials.isFile()) {
try {
new PerJobCredentialStore(job).migrateCredentials(this);
job.save();
if (job.getScm() instanceof SubversionSCM) {
new PerJobCredentialStore(job).migrateCredentials(this);
job.save();
} // else: job is not using Subversion anymore
if (!jobCredentials.delete()) {
LOGGER.log(Level.WARNING, "Could not remove legacy per-job credentials store file: {0}", jobCredentials);
allOk = false;
Expand Down

0 comments on commit 606d958

Please sign in to comment.