Skip to content

Commit

Permalink
[JENKINS-21016] fix git credentials so that password is included in f…
Browse files Browse the repository at this point in the history
…ile and correct syntax of store command
  • Loading branch information
pphillips-techphob authored and ndeloof committed Dec 20, 2013
1 parent bb90484 commit fa5b79e
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -978,7 +978,9 @@ private String launchCommandWithCredentials(ArgumentListBuilder args, File workD

String urlWithCredentials = getGitCrendentialsURL(url, credentials);
store = createGitCredentialsStore(urlWithCredentials);
launchCommandIn(workDir, "config", "--local", "credential.helper", "store --store=\"" + store.getAbsolutePath() + "\"");
// git cli needs forward slashes for the store path
String path = store.getAbsolutePath().replace('\\','/');
launchCommandIn(workDir, "config", "--local", "credential.helper", "store --file=\\\"" + path + "\\\"");
}
}

Expand Down Expand Up @@ -1554,7 +1556,8 @@ private String getGitCrendentialsURL(URIish u, StandardCredentials cred) {
.setPass(Secret.toString(up.getPassword()));
}

return uri.toString();
// use toPrivateString to include the password too
return uri.toPrivateString();
}

/**
Expand Down

0 comments on commit fa5b79e

Please sign in to comment.