Browse Source

ConfigConstants: Add constants for i18n.logOutputEncoding

Change-Id: I6073c7fc8ec30840e2ee2e90ac4cfdb136f48b9a
Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
stable-5.2
David Pursehouse 6 years ago
parent
commit
a5c0a8dfa5
  1. 7
      org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java
  2. 14
      org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java

7
org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/TextBuiltin.java

@ -45,6 +45,8 @@
package org.eclipse.jgit.pgm;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_SECTION_I18N;
import static org.eclipse.jgit.lib.ConfigConstants.CONFIG_KEY_LOG_OUTPUT_ENCODING;
import static org.eclipse.jgit.lib.Constants.R_HEADS;
import static org.eclipse.jgit.lib.Constants.R_REMOTES;
import static org.eclipse.jgit.lib.Constants.R_TAGS;
@ -181,9 +183,10 @@ public abstract class TextBuiltin {
protected void init(Repository repository, String gitDir) {
Charset charset = UTF_8;
if (repository != null) {
String logOutputEncoding = repository.getConfig().getString("i18n", //$NON-NLS-1$
String logOutputEncoding = repository.getConfig().getString(
CONFIG_SECTION_I18N,
null,
"logOutputEncoding");//$NON-NLS-1$
CONFIG_KEY_LOG_OUTPUT_ENCODING);
if (logOutputEncoding != null) {
try {
charset = Charset.forName(logOutputEncoding);

14
org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java

@ -432,4 +432,18 @@ public final class ConfigConstants {
* @since 4.11
*/
public static final String CONFIG_SECTION_LFS = "lfs";
/**
* The "i18n" section
*
* @since 5.2
*/
public static final String CONFIG_SECTION_I18N = "i18n";
/**
* The "logOutputEncoding" key
*
* @since 5.2
*/
public static final String CONFIG_KEY_LOG_OUTPUT_ENCODING = "logOutputEncoding";
}

Loading…
Cancel
Save