DescribeCommandTest: Open FileWriter in try-with-resource

Change-Id: Ida79bdae652faa88fbdb1b81e7e10b5019ff2c16
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
David Pursehouse 2018-03-06 09:49:16 +09:00
parent 3393f78210
commit 6d437a58f1
1 changed files with 3 additions and 3 deletions

View File

@ -297,9 +297,9 @@ private void tag(String tag) throws GitAPIException {
}
private static void touch(File f, String contents) throws Exception {
FileWriter w = new FileWriter(f);
w.write(contents);
w.close();
try (FileWriter w = new FileWriter(f)) {
w.write(contents);
}
}
private String describe(ObjectId c1, boolean longDesc)