Merge changes I343cc3cf,I9dedf61b
* changes: Avoid error-prone warning Fix unused exception error-prone warning
This commit is contained in:
commit
8bd960bf2b
|
@ -90,7 +90,7 @@ public void testWriteWhenGc() throws Exception {
|
||||||
bb.update(tip);
|
bb.update(tip);
|
||||||
|
|
||||||
assertTrue(gc.shouldWriteCommitGraphWhenGc());
|
assertTrue(gc.shouldWriteCommitGraphWhenGc());
|
||||||
gc.gc();
|
gc.gc().get();
|
||||||
File graphFile = new File(repo.getObjectsDirectory(),
|
File graphFile = new File(repo.getObjectsDirectory(),
|
||||||
Constants.INFO_COMMIT_GRAPH);
|
Constants.INFO_COMMIT_GRAPH);
|
||||||
assertGraphFile(graphFile);
|
assertGraphFile(graphFile);
|
||||||
|
@ -103,7 +103,7 @@ public void testDefaultWriteWhenGc() throws Exception {
|
||||||
bb.update(tip);
|
bb.update(tip);
|
||||||
|
|
||||||
assertFalse(gc.shouldWriteCommitGraphWhenGc());
|
assertFalse(gc.shouldWriteCommitGraphWhenGc());
|
||||||
gc.gc();
|
gc.gc().get();
|
||||||
File graphFile = new File(repo.getObjectsDirectory(),
|
File graphFile = new File(repo.getObjectsDirectory(),
|
||||||
Constants.INFO_COMMIT_GRAPH);
|
Constants.INFO_COMMIT_GRAPH);
|
||||||
assertFalse(graphFile.exists());
|
assertFalse(graphFile.exists());
|
||||||
|
@ -123,21 +123,21 @@ public void testDisableWriteWhenGc() throws Exception {
|
||||||
config.setBoolean(ConfigConstants.CONFIG_GC_SECTION, null,
|
config.setBoolean(ConfigConstants.CONFIG_GC_SECTION, null,
|
||||||
ConfigConstants.CONFIG_KEY_WRITE_COMMIT_GRAPH, true);
|
ConfigConstants.CONFIG_KEY_WRITE_COMMIT_GRAPH, true);
|
||||||
|
|
||||||
gc.gc();
|
gc.gc().get();
|
||||||
assertFalse(graphFile.exists());
|
assertFalse(graphFile.exists());
|
||||||
|
|
||||||
config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
|
config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
|
||||||
ConfigConstants.CONFIG_COMMIT_GRAPH, true);
|
ConfigConstants.CONFIG_COMMIT_GRAPH, true);
|
||||||
config.setBoolean(ConfigConstants.CONFIG_GC_SECTION, null,
|
config.setBoolean(ConfigConstants.CONFIG_GC_SECTION, null,
|
||||||
ConfigConstants.CONFIG_KEY_WRITE_COMMIT_GRAPH, false);
|
ConfigConstants.CONFIG_KEY_WRITE_COMMIT_GRAPH, false);
|
||||||
gc.gc();
|
gc.gc().get();
|
||||||
assertFalse(graphFile.exists());
|
assertFalse(graphFile.exists());
|
||||||
|
|
||||||
config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
|
config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
|
||||||
ConfigConstants.CONFIG_COMMIT_GRAPH, false);
|
ConfigConstants.CONFIG_COMMIT_GRAPH, false);
|
||||||
config.setBoolean(ConfigConstants.CONFIG_GC_SECTION, null,
|
config.setBoolean(ConfigConstants.CONFIG_GC_SECTION, null,
|
||||||
ConfigConstants.CONFIG_KEY_WRITE_COMMIT_GRAPH, false);
|
ConfigConstants.CONFIG_KEY_WRITE_COMMIT_GRAPH, false);
|
||||||
gc.gc();
|
gc.gc().get();
|
||||||
assertFalse(graphFile.exists());
|
assertFalse(graphFile.exists());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -247,7 +247,7 @@ public void testWindowCursorGetCommitGraph() throws Exception {
|
||||||
assertTrue(curs.getCommitGraph().isEmpty());
|
assertTrue(curs.getCommitGraph().isEmpty());
|
||||||
commitFile("file.txt", "content", "master");
|
commitFile("file.txt", "content", "master");
|
||||||
GC gc = new GC(db);
|
GC gc = new GC(db);
|
||||||
gc.gc();
|
gc.gc().get();
|
||||||
assertTrue(curs.getCommitGraph().isPresent());
|
assertTrue(curs.getCommitGraph().isPresent());
|
||||||
|
|
||||||
db.getConfig().setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
|
db.getConfig().setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null,
|
||||||
|
@ -286,7 +286,7 @@ public void testGetCommitGraph() throws Exception {
|
||||||
// add commit-graph
|
// add commit-graph
|
||||||
commitFile("file.txt", "content", "master");
|
commitFile("file.txt", "content", "master");
|
||||||
GC gc = new GC(db);
|
GC gc = new GC(db);
|
||||||
gc.gc();
|
gc.gc().get();
|
||||||
File file = new File(db.getObjectsDirectory(),
|
File file = new File(db.getObjectsDirectory(),
|
||||||
Constants.INFO_COMMIT_GRAPH);
|
Constants.INFO_COMMIT_GRAPH);
|
||||||
assertTrue(file.exists());
|
assertTrue(file.exists());
|
||||||
|
@ -296,7 +296,7 @@ public void testGetCommitGraph() throws Exception {
|
||||||
|
|
||||||
// update commit-graph
|
// update commit-graph
|
||||||
commitFile("file2.txt", "content", "master");
|
commitFile("file2.txt", "content", "master");
|
||||||
gc.gc();
|
gc.gc().get();
|
||||||
assertEquals(2, dir.getCommitGraph().get().getCommitCnt());
|
assertEquals(2, dir.getCommitGraph().get().getCommitCnt());
|
||||||
|
|
||||||
// delete commit-graph
|
// delete commit-graph
|
||||||
|
@ -311,7 +311,7 @@ public void testGetCommitGraph() throws Exception {
|
||||||
assertTrue(dir.getCommitGraph().isEmpty());
|
assertTrue(dir.getCommitGraph().isEmpty());
|
||||||
|
|
||||||
// add commit-graph again
|
// add commit-graph again
|
||||||
gc.gc();
|
gc.gc().get();
|
||||||
assertTrue(dir.getCommitGraph().isPresent());
|
assertTrue(dir.getCommitGraph().isPresent());
|
||||||
assertEquals(2, dir.getCommitGraph().get().getCommitCnt());
|
assertEquals(2, dir.getCommitGraph().get().getCommitCnt());
|
||||||
}
|
}
|
||||||
|
|
|
@ -309,7 +309,7 @@ void enableAndWriteCommitGraph() throws Exception {
|
||||||
db.getConfig().setBoolean(ConfigConstants.CONFIG_GC_SECTION, null,
|
db.getConfig().setBoolean(ConfigConstants.CONFIG_GC_SECTION, null,
|
||||||
ConfigConstants.CONFIG_KEY_WRITE_COMMIT_GRAPH, true);
|
ConfigConstants.CONFIG_KEY_WRITE_COMMIT_GRAPH, true);
|
||||||
GC gc = new GC(db);
|
GC gc = new GC(db);
|
||||||
gc.gc();
|
gc.gc().get();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reinitializeRevWalk() {
|
private void reinitializeRevWalk() {
|
||||||
|
|
|
@ -254,7 +254,7 @@ long getSize(WindowCursor curs, AnyObjectId id) throws IOException {
|
||||||
// refresh directory to work around NFS caching issue
|
// refresh directory to work around NFS caching issue
|
||||||
}
|
}
|
||||||
return getSizeWithoutRefresh(curs, id);
|
return getSizeWithoutRefresh(curs, id);
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException unused) {
|
||||||
if (fileFor(id).exists()) {
|
if (fileFor(id).exists()) {
|
||||||
throw noFile;
|
throw noFile;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue