diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java index cedc4d6cc..c80505d70 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/file/FileBasedConfig.java @@ -117,13 +117,11 @@ boolean exists() { @Override public void load() throws IOException, ConfigInvalidException { try { - FileSnapshot[] lastSnapshot = { null }; Boolean wasRead = FileUtils.readWithRetries(getFile(), f -> { final FileSnapshot oldSnapshot = snapshot; final FileSnapshot newSnapshot; // don't use config in this snapshot to avoid endless recursion newSnapshot = FileSnapshot.saveNoConfig(f); - lastSnapshot[0] = newSnapshot; final byte[] in = IO.readFully(f); final ObjectId newHash = hash(in); if (hash.equals(newHash)) { @@ -149,7 +147,7 @@ public void load() throws IOException, ConfigInvalidException { }); if (wasRead == null) { clear(); - snapshot = lastSnapshot[0]; + snapshot = FileSnapshot.MISSING_FILE; } exists.set(wasRead != null); } catch (IOException e) {