ConfigConstants: Add constants for i18n.logOutputEncoding
Change-Id: I6073c7fc8ec30840e2ee2e90ac4cfdb136f48b9a Signed-off-by: David Pursehouse <david.pursehouse@gmail.com>
This commit is contained in:
parent
d54fc955be
commit
a5c0a8dfa5
|
@ -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 void initRaw(final Repository repository, final String gitDir,
|
|||
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);
|
||||
|
|
|
@ -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…
Reference in New Issue