Skip to content

Commit

Permalink
CliGitAPIImpl: reconcile use of PrintWriter with changes in the PR je…
Browse files Browse the repository at this point in the history
  • Loading branch information
jimklimov committed Jun 14, 2023
1 parent 1462bb0 commit 26fba6b
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -874,13 +874,16 @@ public void execute() throws GitException, InterruptedException {
} else {
// Go behind git's back to write a meta file in new workspace
File alternates = new File(workspace, ".git/objects/info/alternates");
try (PrintWriter w = new PrintWriter(alternates, Charset.defaultCharset())) {
try (PrintWriter w = new PrintWriter(
alternates, Charset.defaultCharset().toString())) {
String absoluteReference =
objectsPath.getAbsolutePath().replace('\\', '/');
listener.getLogger().println("Using reference repository: " + reference);
// git implementations on windows also use
w.print(absoluteReference);
} catch (IOException e) {
} catch (UnsupportedEncodingException ex) {
listener.error("Default character set is an unsupported encoding");
} catch (FileNotFoundException e) {
listener.error("Failed to setup reference");
}
}
Expand Down

0 comments on commit 26fba6b

Please sign in to comment.