本文整理了Java中org.eclipse.jgit.lib.Repository.toString
方法的一些代码示例,展示了Repository.toString
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Repository.toString
方法的具体详情如下:
包路径:org.eclipse.jgit.lib.Repository
类名称:Repository
方法名:toString
暂无
代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit
/**
* {@inheritDoc}
* <p>
* Decrement the use count, and maybe close resources.
*/
@Override
public void close() {
int newCount = useCnt.decrementAndGet();
if (newCount == 0) {
if (RepositoryCache.isCached(this)) {
closedAt.set(System.currentTimeMillis());
} else {
doClose();
}
} else if (newCount == -1) {
// should not happen, only log when useCnt became negative to
// minimize number of log entries
String message = MessageFormat.format(JGitText.get().corruptUseCnt,
toString());
if (LOG.isDebugEnabled()) {
LOG.debug(message, new IllegalStateException());
} else {
LOG.warn(message);
}
if (RepositoryCache.isCached(this)) {
closedAt.set(System.currentTimeMillis());
}
}
}
代码示例来源:origin: SAP/vulnerability-assessment-tool
public String getRepoRelativePath(){
/*
String rel_path = null;
Collection<SVNDirEntry> SVNentry = this.rootRepo.getDir("tags/", -1, null,(Collection<SVNDirEntry>) null);
Iterator<SVNDirEntry> iterator = SVNentry.iterator();
if (iterator.hasNext()) {
SVNDirEntry entry = (SVNDirEntry) iterator.next();
// remove the root repository part from the whole url (object: SVNDirEntry)
rel_path = entry.getURL().toString().replaceAll(entry.getRepositoryRoot().toString(), "");
}else{
SvnClient.log.error("[Error] while getting the relative path for tag directory");
}
rel_path = rel_path.substring(0, rel_path.lastIndexOf('/'));
return rel_path;
*/
//TODO: To be tested
return url.toString().replace(repository.toString(), "");
}
代码示例来源:origin: com.madgag/org.eclipse.jgit.pgm
private String repoName() {
final File gitDir = db.getDirectory();
if (gitDir == null)
return db.toString();
String n = gitDir.getName();
if (Constants.DOT_GIT.equals(n))
n = gitDir.getParentFile().getName();
return n;
}
}
代码示例来源:origin: berlam/github-bucket
/**
* {@inheritDoc}
* <p>
* Decrement the use count, and maybe close resources.
*/
@Override
public void close() {
int newCount = useCnt.decrementAndGet();
if (newCount == 0) {
if (RepositoryCache.isCached(this)) {
closedAt.set(System.currentTimeMillis());
} else {
doClose();
}
} else if (newCount == -1) {
// should not happen, only log when useCnt became negative to
// minimize number of log entries
String message = MessageFormat.format(JGitText.get().corruptUseCnt,
toString());
if (LOG.isDebugEnabled()) {
LOG.debug(message, new IllegalStateException());
} else {
LOG.warn(message);
}
if (RepositoryCache.isCached(this)) {
closedAt.set(System.currentTimeMillis());
}
}
}
代码示例来源:origin: bozaro/git-as-svn
} finally {
final long endTime = System.currentTimeMillis();
log.info("{} hook for repository {} took {}ms", hook, repository.toString(), (endTime - startTime));
代码示例来源:origin: org.apache.stratos/org.apache.stratos.cartridge.agent
public static boolean addRemote(Repository repository, String remoteUrl) {
boolean remoteAdded = false;
StoredConfig config = repository.getConfig();
config.setString(GitDeploymentSynchronizerConstants.REMOTE,
GitDeploymentSynchronizerConstants.ORIGIN,
GitDeploymentSynchronizerConstants.URL,
remoteUrl);
config.setString(GitDeploymentSynchronizerConstants.REMOTE,
GitDeploymentSynchronizerConstants.ORIGIN,
GitDeploymentSynchronizerConstants.FETCH,
GitDeploymentSynchronizerConstants.FETCH_LOCATION);
config.setString(GitDeploymentSynchronizerConstants.BRANCH,
GitDeploymentSynchronizerConstants.MASTER,
GitDeploymentSynchronizerConstants.REMOTE,
GitDeploymentSynchronizerConstants.ORIGIN);
config.setString(GitDeploymentSynchronizerConstants.BRANCH,
GitDeploymentSynchronizerConstants.MASTER,
GitDeploymentSynchronizerConstants.MERGE,
GitDeploymentSynchronizerConstants.GIT_REFS_HEADS_MASTER);
try {
config.save();
remoteAdded = true;
} catch (IOException e) {
log.error("Error in adding remote origin " + remoteUrl + " for local repository " +
repository.toString(), e);
}
return remoteAdded;
}
内容来源于网络,如有侵权,请联系作者删除!