本文整理汇总了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));
}
示例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);
}
}
示例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);
}
}
}
示例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()));
}
示例5: conciseSummary
import org.eclipse.jgit.transport.RemoteConfig; //导入方法依赖的package包/类
@Override
CharSequence conciseSummary(RemoteConfig rc) {
return rc.getName() + ": " + rc.getURIs().get(0);
}
示例6: idFor
import org.eclipse.jgit.transport.RemoteConfig; //导入方法依赖的package包/类
@Override
public String idFor(RemoteConfig e) {
return e.getName();
}