summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
index 671abaec95..a2e0a571eb 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
@@ -20,6 +20,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.security.MessageDigest;
+import java.time.Instant;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -202,6 +203,16 @@ public class TestRepository<R extends Repository> implements AutoCloseable {
}
/**
+ * Get instant
+ *
+ * @return current instant.
+ * @since 6.8
+ */
+ public Instant getInstant() {
+ return Instant.ofEpochMilli(mockSystemReader.getCurrentTime());
+ }
+
+ /**
* Get timezone
*
* @return timezone used for default identities.