热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

org.eclipse.jgit.api.DeleteTagCommand类的使用及代码示例

本文整理了Java中org.eclipse.jgit.api.DeleteTagCommand类的一些代码示例,展示了DeleteTagCommand

本文整理了Java中org.eclipse.jgit.api.DeleteTagCommand类的一些代码示例,展示了DeleteTagCommand类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。DeleteTagCommand类的具体详情如下:
包路径:org.eclipse.jgit.api.DeleteTagCommand
类名称:DeleteTagCommand

DeleteTagCommand介绍

[英]Used to delete one or several tags. The result of #call() is a list with the (full) names of the deleted tags.
[中]用于删除一个或多个标记。#call()的结果是一个列表,其中包含已删除标记的(完整)名称。

代码示例

代码示例来源:origin: centic9/jgit-cookbook

try (Git git = new Git(repository)) {
git.tagDelete().setTags("tag_for_testing").call();
git.tagDelete().setTags("tag_for_testing").call();
git.tagDelete().setTags("tag_for_testing").call();
git.tagDelete().setTags("tag_for_testing").call();

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
* Return a command object used to delete tags
*
* @return a {@link org.eclipse.jgit.api.DeleteTagCommand}
*/
public DeleteTagCommand tagDelete() {
return new DeleteTagCommand(repo);
}

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

checkCallable();
List result = new ArrayList<>();
if (tags.isEmpty())
return result;
try {
setCallable(false);
for (String tagName : tags) {
if (tagName == null)

代码示例来源:origin: org.eclipse.jgit/org.eclipse.jgit

/**
* Set names of the tags to delete
*
* @param tags
* the names of the tags to delete; if not set, this will do
* nothing; invalid tag names will simply be ignored
* @return this instance
*/
public DeleteTagCommand setTags(String... tags) {
checkCallable();
this.tags.clear();
for (String tagName : tags)
this.tags.add(tagName);
return this;
}
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

/**
* @param tags
* the names of the tags to delete; if not set, this will do
* nothing; invalid tag names will simply be ignored
* @return this instance
*/
public DeleteTagCommand setTags(String... tags) {
checkCallable();
this.tags.clear();
for (String tagName : tags)
this.tags.add(tagName);
return this;
}
}

代码示例来源:origin: centic9/jgit-cookbook

try (Git git = new Git(repository)) {
git.tagDelete().setTags("tag_for_testing").call();
git.tagDelete().setTags("tag_for_testing").call();
git.tagDelete().setTags("tag_for_testing").call();
git.tagDelete().setTags("tag_for_testing").call();

代码示例来源:origin: berlam/github-bucket

checkCallable();
List result = new ArrayList<>();
if (tags.isEmpty())
return result;
try {
setCallable(false);
for (String tagName : tags) {
if (tagName == null)

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

/**
* Returns a command object used to delete tags
*
* @return a {@link DeleteTagCommand}
*/
public DeleteTagCommand tagDelete() {
return new DeleteTagCommand(repo);
}

代码示例来源:origin: berlam/github-bucket

/**
* Set names of the tags to delete
*
* @param tags
* the names of the tags to delete; if not set, this will do
* nothing; invalid tag names will simply be ignored
* @return this instance
*/
public DeleteTagCommand setTags(String... tags) {
checkCallable();
this.tags.clear();
for (String tagName : tags)
this.tags.add(tagName);
return this;
}
}

代码示例来源:origin: org.wildfly.core/wildfly-server

@Override
public void deleteSnapshot(String name) {
try (Git git = gitRepository.getGit()) {
git.tagDelete().setTags(name).call();
} catch (GitAPIException ex) {
MGMT_OP_LOGGER.failedToDeleteConfigurationSnapshot(ex,name);
}
}

代码示例来源:origin: sonia.jgit/org.eclipse.jgit

checkCallable();
List result = new ArrayList();
if (tags.isEmpty())
return result;
try {
setCallable(false);
for (String tagName : tags) {
if (tagName == null)

代码示例来源:origin: berlam/github-bucket

/**
* Return a command object used to delete tags
*
* @return a {@link org.eclipse.jgit.api.DeleteTagCommand}
*/
public DeleteTagCommand tagDelete() {
return new DeleteTagCommand(repo);
}

代码示例来源:origin: wildfly/wildfly-core

@Override
public void deleteSnapshot(String name) {
try (Git git = gitRepository.getGit()) {
git.tagDelete().setTags(name).call();
} catch (GitAPIException ex) {
MGMT_OP_LOGGER.failedToDeleteConfigurationSnapshot(ex,name);
}
}

代码示例来源:origin: org.apache.camel/camel-git

protected void doDeleteTag(Exchange exchange, String operation) throws Exception {
if (ObjectHelper.isEmpty(endpoint.getTagName())) {
throw new IllegalArgumentException("Tag Name must be specified to execute " + operation);
}
try {
git.tagDelete().setTags(endpoint.getTagName()).call();
} catch (Exception e) {
LOG.error("There was an error in Git {} operation", operation);
throw e;
}
}

代码示例来源:origin: jenkinsci/git-client-plugin

/** {@inheritDoc} */
@Override
public void deleteTag(String tagName) throws GitException {
try (Repository repo = getRepository()) {
git(repo).tagDelete().setTags(tagName).call();
} catch (GitAPIException e) {
throw new GitException(e);
}
}

代码示例来源:origin: org.apereo.cas/cas-mgmt-support-version-control

/**
* Method will tag the current HEAD commit has being the latest published.
*/
@SneakyThrows
public void setPublished() {
if (!isUndefined()) {
git.tagDelete().setTags("published").call();
git.tag().setName("published").call();
}
}

代码示例来源:origin: org.openmrs.maven.plugins/openmrs-sdk-maven-plugin

/**
* @inheritDoc
*/
@Override
public boolean deleteTag(Git git, String tag, String username, String password){
Ref tagRef = git.getRepository().getTags().get(tag);
if(tagRef != null){
try {
//delete remote tag, if
UsernamePasswordCredentialsProvider credentialsProvider = new UsernamePasswordCredentialsProvider(username, password);
git.push()
.setCredentialsProvider(credentialsProvider)
.add(":"+tagRef)
.setRemote("upstream")
.call();
git.tagDelete().setTags(tagRef.getName()).call();
return true;
} catch (GitAPIException e) {
throw new RuntimeException("Failed to delete tag "+tag, e);
}
} else {
return false;
}
}

代码示例来源:origin: theonedev/onedev

public void deleteTag(String tag) {
String refName = GitUtils.tag2ref(tag);
ObjectId commitId = getRevCommit(refName).getId();
try {
git().tagDelete().setTags(tag).call();
} catch (GitAPIException e) {
throw new RuntimeException(e);
}
Subject subject = SecurityUtils.getSubject();
OneDev.getInstance(UnitOfWork.class).doAsync(new Runnable() {
@Override
public void run() {
ThreadContext.bind(subject);
try {
Project project = OneDev.getInstance(ProjectManager.class).load(getId());
OneDev.getInstance(ListenerRegistry.class).post(
new RefUpdated(project, refName, commitId, ObjectId.zeroId()));
} finally {
ThreadContext.unbindSubject();
}
}

});
}

代码示例来源:origin: sheimi/SGit

case Repo.COMMIT_TYPE_TAG:
mRepo.getGit().tagDelete()
.setTags(mChosenCommit)
.call();
break;

代码示例来源:origin: maks/MGit

case Repo.COMMIT_TYPE_TAG:
mRepo.getGit().tagDelete()
.setTags(mChosenCommit)
.call();
break;

推荐阅读
author-avatar
魔帝君
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有