本文整理了Java中org.eclipse.jgit.api.Git.stashDrop()
方法的一些代码示例,展示了Git.stashDrop()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Git.stashDrop()
方法的具体详情如下:
包路径:org.eclipse.jgit.api.Git
类名称:Git
方法名:stashDrop
[英]Return a command object used to drop a stashed commit
[中]返回用于删除隐藏的提交的命令对象
代码示例来源:origin: jphp-group/jphp
@Signature
public Memory stashDrop(ArrayMemory settings) throws GitAPIException {
StashDropCommand command = getWrappedObject().stashDrop();
if (settings != null) {
command.setAll(settings.valueOfIndex("all").toBoolean());
Memory stashRef = settings.valueOfIndex("stashRef");
if (stashRef.isNotNull()) {
command.setStashRef(stashRef.toInteger());
}
}
return GitUtils.valueOf(command.call());
}
代码示例来源:origin: centic9/jgit-cookbook
ObjectId call = git.stashDrop().setStashRef(0).call();
System.out.println("StashDrop returned: " + call);
代码示例来源:origin: centic9/jgit-cookbook
ObjectId call = git.stashDrop().setStashRef(0).call();
System.out.println("StashDrop returned: " + call);
代码示例来源:origin: org.jboss.forge.addon/git-impl
@Override
public void stashDrop(final Git repo) throws GitAPIException
{
repo.stashDrop().call();
}
代码示例来源:origin: alien4cloud/alien4cloud
public static void dropStash(Path repositoryDirectory, String stashId){
Git git = null;
try {
git = Git.open(repositoryDirectory.toFile());
int stashIndex = 0;
Collection<RevCommit> stashes = git.stashList().call();
for (RevCommit stash : stashes) {
if (stash.getFullMessage().equals(stashId)) {
git.stashDrop().setStashRef(stashIndex).call();
log.debug("Stash <" + stashId + "> has been dropped on <" + repositoryDirectory + ">");
}
stashIndex++;
}
} catch (IOException | GitAPIException e) {
throw new GitException("Failed to apply then drop stash", e);
} finally {
close(git);
}
}
代码示例来源:origin: alien4cloud/alien4cloud
public static void stash(Path repositoryDirectory, String stashId) {
Git git = null;
try {
log.debug("Stashing change from <" + repositoryDirectory + "> to stash <" + stashId + ">");
git = Git.open(repositoryDirectory.toFile());
Collection<RevCommit> stashes = git.stashList().call();
int stashIndex = 0;
for (RevCommit stash : stashes) {
if (stash.getFullMessage().equals(stashId)) {
git.stashDrop().setStashRef(stashIndex).call();
log.warn("Stash <" + stashId + "> was already existing in <" + repositoryDirectory + ">. It has been deleted.");
break;
}
stashIndex++;
}
git.stashCreate().setIncludeUntracked(true).setWorkingDirectoryMessage(stashId).call();
} catch (IOException | GitAPIException e) {
throw new GitException("Failed to stash data", e);
} finally {
close(git);
}
}
代码示例来源:origin: alien4cloud/alien4cloud
public static void applyStashThenDrop(Path repositoryDirectory, String stashId) {
Git git = null;
try {
git = Git.open(repositoryDirectory.toFile());
int stashIndex = 0;
Collection<RevCommit> stashes = git.stashList().call();
for (RevCommit stash : stashes) {
if (stash.getFullMessage().equals(stashId)) {
git.stashApply().setStashRef(stash.getName()).call();
git.stashDrop().setStashRef(stashIndex).call();
log.debug("Stash <" + stashId + "> applied/dropped on <" + repositoryDirectory + ">");
break;
}
stashIndex++;
}
} catch (IOException | GitAPIException e) {
throw new GitException("Failed to apply then drop stash", e);
} finally {
close(git);
}
}
内容来源于网络,如有侵权,请联系作者删除!