Skip to content

git config always changes the encoding of .git/config and ~/.gitconfig to value of _ENCODE_FILE_NEW #141

@Christopher-Chappell

Description

@Christopher-Chappell

Introducing any git config commands into a Jenkins pipeline causes the next run that touches that repository to fail. Why? Because even if I chtag the config file to ISO8859-1, the moment git modifies it it goes back to IBM-1047.

Jenkins does not tolerate a git config file anywhere that is encoded IBM-1047. If it finds one, the pipeline fails with the following error:

Fetching changes from the remote Git repository
ERROR: Checkout failed
org.eclipse.jgit.errors.ConfigInvalidException: Invalid line in config file
	at PluginClassLoader for git-client//org.eclipse.jgit.lib.Config.fromTextRecurse(Config.java:1236)
	at PluginClassLoader for git-client//org.eclipse.jgit.lib.Config.fromText(Config.java:1164)
	at PluginClassLoader for git-client//org.eclipse.jgit.storage.file.FileBasedConfig.load(FileBasedConfig.java:164)
	at PluginClassLoader for git-client//org.eclipse.jgit.util.FileUtils.readWithRetries(FileUtils.java:733)
	at PluginClassLoader for git-client//org.eclipse.jgit.storage.file.FileBasedConfig.load(FileBasedConfig.java:128)

As you can imagine, I am interested in making sure that any git config files stay ISO8859-1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions