Skip to content

Commit

Permalink
[JENKINS-46737] Improve logging when linking a reference repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dohbedoh committed Sep 11, 2017
1 parent 51ec170 commit 098385b
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 098385b

Please sign in to comment.