当前位置: 首页>>代码示例>>Java>>正文


Java RemoteConfig.getName方法代码示例

本文整理汇总了Java中org.eclipse.jgit.transport.RemoteConfig.getName方法的典型用法代码示例。如果您正苦于以下问题:Java RemoteConfig.getName方法的具体用法?Java RemoteConfig.getName怎么用?Java RemoteConfig.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jgit.transport.RemoteConfig的用法示例。


在下文中一共展示了RemoteConfig.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: DestinationConfiguration

import org.eclipse.jgit.transport.RemoteConfig; //导入方法依赖的package包/类
DestinationConfiguration(RemoteConfig remoteConfig, Config cfg) {
  this.remoteConfig = remoteConfig;
  String name = remoteConfig.getName();
  urls = ImmutableList.copyOf(cfg.getStringList("remote", name, "url"));
  delay = Math.max(0, getInt(remoteConfig, cfg, "replicationdelay", DEFAULT_REPLICATION_DELAY));
  rescheduleDelay =
      Math.max(3, getInt(remoteConfig, cfg, "rescheduledelay", DEFAULT_RESCHEDULE_DELAY));
  projects = ImmutableList.copyOf(cfg.getStringList("remote", name, "projects"));
  adminUrls = ImmutableList.copyOf(cfg.getStringList("remote", name, "adminUrl"));
  retryDelay = Math.max(0, getInt(remoteConfig, cfg, "replicationretry", 1));
  poolThreads = Math.max(0, getInt(remoteConfig, cfg, "threads", 1));
  authGroupNames = ImmutableList.copyOf(cfg.getStringList("remote", name, "authGroup"));
  lockErrorMaxRetries = cfg.getInt("replication", "lockErrorMaxRetries", 0);

  createMissingRepos = cfg.getBoolean("remote", name, "createMissingRepositories", true);
  replicatePermissions = cfg.getBoolean("remote", name, "replicatePermissions", true);
  replicateProjectDeletions = cfg.getBoolean("remote", name, "replicateProjectDeletions", false);
  replicateHiddenProjects = cfg.getBoolean("remote", name, "replicateHiddenProjects", false);
  remoteNameStyle =
      MoreObjects.firstNonNull(cfg.getString("remote", name, "remoteNameStyle"), "slash");
  maxRetries =
      getInt(
          remoteConfig, cfg, "replicationMaxRetries", cfg.getInt("replication", "maxRetries", 0));
}
 
开发者ID:GerritCodeReview,项目名称:plugins_replication,代码行数:25,代码来源:DestinationConfiguration.java

示例2: prune

import org.eclipse.jgit.transport.RemoteConfig; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void prune(RemoteConfig repository) throws GitException {
    try (Repository gitRepo = getRepository()) {
        String remote = repository.getName();
        String prefix = "refs/remotes/" + remote + "/";

        Set<String> branches = listRemoteBranches(remote);

        for (Ref r : new ArrayList<>(gitRepo.getAllRefs().values())) {
            if (r.getName().startsWith(prefix) && !branches.contains(r.getName())) {
                // delete this ref
                RefUpdate update = gitRepo.updateRef(r.getName());
                update.setRefLogMessage("remote branch pruned", false);
                update.setForceUpdate(true);
                Result res = update.delete();
            }
        }
    } catch (URISyntaxException | IOException e) {
        throw new GitException(e);
    }
}
 
开发者ID:jenkinsci,项目名称:git-client-plugin,代码行数:22,代码来源:JGitAPIImpl.java

示例3: prune

import org.eclipse.jgit.transport.RemoteConfig; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void prune(RemoteConfig repository) throws GitException, InterruptedException {
    String repoName = repository.getName();
    String repoUrl = getRemoteUrl(repoName);
    if (repoUrl != null && !repoUrl.isEmpty()) {
        ArgumentListBuilder args = new ArgumentListBuilder();
        args.add("remote", "prune", repoName);

        StandardCredentials cred = credentials.get(repoUrl);
        if (cred == null) cred = defaultCredentials;

        try {
            launchCommandWithCredentials(args, workspace, cred, new URIish(repoUrl));
        } catch (URISyntaxException ex) {
            throw new GitException("Invalid URL " + repoUrl, ex);
        }
    }
}
 
开发者ID:jenkinsci,项目名称:git-client-plugin,代码行数:19,代码来源:CliGitAPIImpl.java

示例4: fromRemoteConfig

import org.eclipse.jgit.transport.RemoteConfig; //导入方法依赖的package包/类
static GitRemoteConfig fromRemoteConfig (RemoteConfig config) {
    return new GitRemoteConfig(config.getName(),
            getAsStrings(config.getURIs()),
            getAsStrings(config.getPushURIs()),
            getAsStrings(config.getFetchRefSpecs()),
            getAsStrings(config.getPushRefSpecs()));
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:GitRemoteConfig.java

示例5: conciseSummary

import org.eclipse.jgit.transport.RemoteConfig; //导入方法依赖的package包/类
@Override
CharSequence conciseSummary(RemoteConfig rc) {
    return rc.getName() + ": " + rc.getURIs().get(0);
}
 
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:5,代码来源:RDTRemote.java

示例6: idFor

import org.eclipse.jgit.transport.RemoteConfig; //导入方法依赖的package包/类
@Override
public String idFor(RemoteConfig e) {
    return e.getName();
}
 
开发者ID:m4rzEE1,项目名称:ninja_chic-,代码行数:5,代码来源:RDTRemote.java


注:本文中的org.eclipse.jgit.transport.RemoteConfig.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。