]> source.dussan.org Git - jgit.git/commitdiff
Config: do not add spaces before units 83/83483/1
authorDavid Turner <dturner@twosigma.com>
Fri, 14 Oct 2016 20:44:51 +0000 (16:44 -0400)
committerDavid Pursehouse <david.pursehouse@gmail.com>
Wed, 19 Oct 2016 01:58:52 +0000 (10:58 +0900)
Adding a space before the unit ('g', 'm', 'k) causes git to fail with
the error:

  fatal: bad numeric config value

Change-Id: I57f11d3a1cdcca4549858e773af1a2a80fc0369f
Signed-off-by: David Turner <dturner@twosigma.com>
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
org.eclipse.jgit/src/org/eclipse/jgit/lib/Config.java

index a041bb70c4b35edcf23de3b4d2b83ed112d32851..8fe8a96e99234813825f6c155a2386fe5e624aad 100644 (file)
@@ -835,11 +835,11 @@ public class Config {
                final String s;
 
                if (value >= GiB && (value % GiB) == 0)
-                       s = String.valueOf(value / GiB) + " g"; //$NON-NLS-1$
+                       s = String.valueOf(value / GiB) + "g"; //$NON-NLS-1$
                else if (value >= MiB && (value % MiB) == 0)
-                       s = String.valueOf(value / MiB) + " m"; //$NON-NLS-1$
+                       s = String.valueOf(value / MiB) + "m"; //$NON-NLS-1$
                else if (value >= KiB && (value % KiB) == 0)
-                       s = String.valueOf(value / KiB) + " k"; //$NON-NLS-1$
+                       s = String.valueOf(value / KiB) + "k"; //$NON-NLS-1$
                else
                        s = String.valueOf(value);