summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorMatthias Sohn <matthias.sohn@sap.com>2019-06-21 17:58:56 +0200
committerMatthias Sohn <matthias.sohn@sap.com>2019-07-11 10:12:04 +0200
commit121c957405d96b75e0e645717913d6c2786306c4 (patch)
tree2d1de85c6c284d68a533d8f5dec87f760043a74e /org.eclipse.jgit
parenta950eac23b94cb5cce5f75b1a7eb9a436950d3ee (diff)
downloadjgit-121c957405d96b75e0e645717913d6c2786306c4.tar.gz
jgit-121c957405d96b75e0e645717913d6c2786306c4.zip
Add support for nanoseconds and microseconds for Config#getTimeUnit
Change-Id: I0a5828438810dd23790cba52d7ae2e055c6a3fc9 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java b/org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java
index 891c7f23b4..001ae93a0c 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/lib/DefaultTypedConfigGetter.java
@@ -226,6 +226,14 @@ public class DefaultTypedConfigGetter implements TypedConfigGetter {
inputUnit = wantUnit;
inputMul = 1;
+ } else if (match(unitName, "ns", "nanoseconds")) { //$NON-NLS-1$ //$NON-NLS-2$
+ inputUnit = TimeUnit.NANOSECONDS;
+ inputMul = 1;
+
+ } else if (match(unitName, "us", "microseconds")) { //$NON-NLS-1$ //$NON-NLS-2$
+ inputUnit = TimeUnit.MICROSECONDS;
+ inputMul = 1;
+
} else if (match(unitName, "ms", "milliseconds")) { //$NON-NLS-1$ //$NON-NLS-2$
inputUnit = TimeUnit.MILLISECONDS;
inputMul = 1;