|
|
@ -270,19 +270,19 @@ public class ReflogReaderTest extends SampleDataRepositoryTestCase { |
|
|
|
|
|
|
|
|
|
|
|
private void setupReflog(String logName, byte[] data) |
|
|
|
private void setupReflog(String logName, byte[] data) |
|
|
|
throws FileNotFoundException, IOException { |
|
|
|
throws FileNotFoundException, IOException { |
|
|
|
File logfile = new File(db.getDirectory(), logName); |
|
|
|
File logfile = new File(db.getDirectory(), logName); |
|
|
|
if (!logfile.getParentFile().mkdirs() |
|
|
|
if (!logfile.getParentFile().mkdirs() |
|
|
|
&& !logfile.getParentFile().isDirectory()) { |
|
|
|
&& !logfile.getParentFile().isDirectory()) { |
|
|
|
throw new IOException( |
|
|
|
throw new IOException( |
|
|
|
"oops, cannot create the directory for the test reflog file" |
|
|
|
"oops, cannot create the directory for the test reflog file" |
|
|
|
+ logfile); |
|
|
|
+ logfile); |
|
|
|
} |
|
|
|
} |
|
|
|
FileOutputStream fileOutputStream = new FileOutputStream(logfile); |
|
|
|
FileOutputStream fileOutputStream = new FileOutputStream(logfile); |
|
|
|
try { |
|
|
|
try { |
|
|
|
fileOutputStream.write(data); |
|
|
|
fileOutputStream.write(data); |
|
|
|
} finally { |
|
|
|
} finally { |
|
|
|
fileOutputStream.close(); |
|
|
|
fileOutputStream.close(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|