| commit | 3f5de671aa4ef4128c65bfe00abdcf6466f4917e | [log] [tgz] |
|---|---|---|
| author | Matthias Sohn <matthias.sohn@sap.com> | Wed Sep 03 16:03:17 2025 +0200 |
| committer | Matthias Sohn <matthias.sohn@sap.com> | Wed Sep 03 16:03:17 2025 +0200 |
| tree | 647fab9f6c63adbdfa1227af4ab4066ea9e7aadc | |
| parent | 06756ba9ed8d3da6e954ca8660f65e57fc1952d3 [diff] |
Fix NPE when calling GC.prune(Set<ObjectId>) This bug was introduced by Ib641211e7bbf8ff6947d81910c24b2640fbdb4e7 where lastRepackTime type switched from a long (that defaulted to 0, representing the start of the Unix epoch) to type Instant that defaults to null which causes the NPE. Instead lastRepackTime should default to Instant.EPOCH to ensure correct behavior. Bug: jgit-199 Change-Id: I327dead16ae905646a7613c557d4833d7b9fd9b5
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java index 6001a7a..641190a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/GC.java
@@ -183,7 +183,7 @@ public static void setExecutor(ExecutorService e) { * prune() to inspect only those reflog entries which have been added since * last repack(). */ - private Instant lastRepackTime; + private Instant lastRepackTime = Instant.EPOCH; /** * Whether gc should do automatic housekeeping