Example usage for org.eclipse.jgit.lib Repository getRemoteName

List of usage examples for org.eclipse.jgit.lib Repository getRemoteName

Introduction

In this page you can find the example usage for org.eclipse.jgit.lib Repository getRemoteName.

Prototype

@Nullable
public String getRemoteName(String refName) 

Source Link

Document

Get remote name

Usage

From source file:org.craftercms.studio.impl.v1.deployment.EnvironmentStoreGitBranchDeployer.java

License:Open Source License

private void addWorkAreaRemote(String site, Repository envStoreRepo) {
    envStoreRepo.getRemoteName("work-area");
    Git git = new Git(envStoreRepo);
    StoredConfig config = git.getRepository().getConfig();
    Path siteRepoPath = Paths.get(rootPath, "sites", site, ".git");
    config.setString("remote", "work-area", "url", siteRepoPath.normalize().toAbsolutePath().toString());
    try {/* w  w w  . j  a  va 2 s  . c om*/
        config.save();
    } catch (IOException e) {
        logger.error("Error adding work area as remote for environment store.", e);
    }
}