diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2010-09-15 08:44:27 -0700 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2010-09-15 08:47:17 -0700 |
commit | a424b7aefebffcd66ed8b0684c0139432c275b29 (patch) | |
tree | 4280d947c2e1c91b8bea83456a382c2f90bfa29d /org.eclipse.jgit.pgm/src/org/eclipse | |
parent | 5fce8d81d89a3b9790e93590b919f5af114e8628 (diff) | |
download | jgit-a424b7aefebffcd66ed8b0684c0139432c275b29.tar.gz jgit-a424b7aefebffcd66ed8b0684c0139432c275b29.zip |
clone: Correct formatting of init message
We used the wrong format method, which lead to this confusing output:
$ ./jgit clone git://...
Initialized empty Git repository in {0}
remote: Counting objects: 201783
...
remote: {0}
We need to use MessageFormat.format() as the message translations
use {0} syntax and not %s syntax for placeholders.
Change-Id: I8bf0fd3f7dbecf9edf47419c46aed0493d405f9e
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit.pgm/src/org/eclipse')
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java | 10 | ||||
-rw-r--r-- | org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java index 356966ab59..fd7fd4459b 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/AbstractFetchCommand.java @@ -49,6 +49,7 @@ package org.eclipse.jgit.pgm; import java.io.IOException; import java.io.PrintWriter; +import java.text.MessageFormat; import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.ObjectId; @@ -104,16 +105,19 @@ abstract class AbstractFetchCommand extends TextBuiltin { else if (0 <= cr) s = cr; else { - writer.format(CLIText.get().remoteMessage, pkt); + writer.print(MessageFormat.format(CLIText.get().remoteMessage, + pkt)); writer.println(); break; } if (pkt.charAt(s) == '\r') { - writer.format(CLIText.get().remoteMessage, pkt.substring(0, s)); + writer.print(MessageFormat.format(CLIText.get().remoteMessage, + pkt.substring(0, s))); writer.print('\r'); } else { - writer.format(CLIText.get().remoteMessage, pkt.substring(0, s)); + writer.print(MessageFormat.format(CLIText.get().remoteMessage, + pkt.substring(0, s))); writer.println(); } diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java index 1b1a8c28e8..1b04989670 100644 --- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java +++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Clone.java @@ -114,7 +114,9 @@ class Clone extends AbstractFetchCommand { dst.getConfig().save(); db = dst; - out.format(CLIText.get().initializedEmptyGitRepositoryIn, gitdir.getAbsolutePath()); + out.print(MessageFormat.format( + CLIText.get().initializedEmptyGitRepositoryIn, gitdir + .getAbsolutePath())); out.println(); out.flush(); |