Example usage for org.eclipse.jgit.lib ConfigConstants CONFIG_KEY_FILEMODE

List of usage examples for org.eclipse.jgit.lib ConfigConstants CONFIG_KEY_FILEMODE

Introduction

In this page you can find the example usage for org.eclipse.jgit.lib ConfigConstants CONFIG_KEY_FILEMODE.

Prototype

String CONFIG_KEY_FILEMODE

To view the source code for org.eclipse.jgit.lib ConfigConstants CONFIG_KEY_FILEMODE.

Click Source Link

Document

The "filemode" key

Usage

From source file:ezbake.deployer.publishers.openShift.RhcApplication.java

License:Apache License

/**
 * Sets the git repository object.  Probably not useful but here for Java Bean completeness
 *
 * @param gitRepo - git repository to set it to
 *//*from  w  w  w .  j  ava2 s . c om*/
public void setGitRepo(Git gitRepo) throws DeploymentException {
    this.gitRepo = gitRepo;

    try {
        StoredConfig config = gitRepo.getRepository().getConfig();
        config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_FILEMODE, true);
        config.save();
    } catch (IOException e) {
        log.error("There was an error saving the  git configuration to disk", e);
        throw new DeploymentException("Could not save git configuration: " + e.getMessage());
    }
}

From source file:org.eclipse.orion.server.git.servlets.GitCloneHandlerV1.java

License:Open Source License

static void doConfigureClone(Git git, String user) throws IOException, CoreException {
    StoredConfig config = git.getRepository().getConfig();
    IOrionUserProfileNode userNode = UserServiceHelper.getDefault().getUserProfileService()
            .getUserProfileNode(user, true).getUserProfileNode(IOrionUserProfileConstants.GENERAL_PROFILE_PART);
    if (userNode.get(GitConstants.KEY_NAME, null) != null)
        config.setString(ConfigConstants.CONFIG_USER_SECTION, null, ConfigConstants.CONFIG_KEY_NAME,
                userNode.get(GitConstants.KEY_NAME, null));
    if (userNode.get(GitConstants.KEY_MAIL, null) != null)
        config.setString(ConfigConstants.CONFIG_USER_SECTION, null, ConfigConstants.CONFIG_KEY_EMAIL,
                userNode.get(GitConstants.KEY_MAIL, null));
    config.setBoolean(ConfigConstants.CONFIG_CORE_SECTION, null, ConfigConstants.CONFIG_KEY_FILEMODE, false);
    config.save();// w ww  . j av  a  2s . co m
}