Skip to content

Commit

Permalink
Merge pull request #272 from Dohbedoh/feature/JENKINS-46737
Browse files Browse the repository at this point in the history
[JENKINS-46737] Improve logging when linking a reference repository.
  • Loading branch information
MarkEWaite committed Sep 30, 2017
2 parents 85e6a0d + 098385b commit 55d96f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -537,8 +537,10 @@ else if (!referencePath.isDirectory())
else {
File alternates = new File(workspace, ".git/objects/info/alternates");
try (PrintWriter w = new PrintWriter(alternates, Charset.defaultCharset().toString())) {
String absoluteReference = objectsPath.getAbsolutePath().replace('\\', '/');
listener.getLogger().println("Link to the reference repository " + absoluteReference);
// git implementations on windows also use
w.print(objectsPath.getAbsolutePath().replace('\\', '/'));
w.print(absoluteReference);
} catch (UnsupportedEncodingException ex) {
listener.error("Default character set is an unsupported encoding");
} catch (FileNotFoundException e) {
Expand Down
Expand Up @@ -1423,10 +1423,12 @@ else if (!referencePath.isDirectory())
else {
try {
File alternates = new File(workspace, ".git/objects/info/alternates");
String absoluteReference = objectsPath.getAbsolutePath().replace('\\', '/');
listener.getLogger().println("Link to the reference repository " + absoluteReference);
// git implementations on windows also use
try (PrintWriter w = new PrintWriter(alternates, "UTF-8")) {
// git implementations on windows also use
w.print(objectsPath.getAbsolutePath().replace('\\', '/'));
w.print(absoluteReference);
}
} catch (FileNotFoundException e) {
listener.error("Failed to setup reference");
Expand Down

0 comments on commit 55d96f5

Please sign in to comment.