本文整理汇总了Java中org.eclipse.jgit.api.errors.NotMergedException类的典型用法代码示例。如果您正苦于以下问题:Java NotMergedException类的具体用法?Java NotMergedException怎么用?Java NotMergedException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NotMergedException类属于org.eclipse.jgit.api.errors包,在下文中一共展示了NotMergedException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: switchToMainAndDeleteFrom
点赞 3
import org.eclipse.jgit.api.errors.NotMergedException; //导入依赖的package包/类
/**
* Switch to the main branch and delete the temporary branch.
*
* @throws GitAPIException
* @throws RefAlreadyExistsException
* @throws RefNotFoundException
* @throws InvalidRefNameException
* @throws CheckoutConflictException
* @throws NotMergedException
* @throws CannotDeleteCurrentBranchException
*/
private void switchToMainAndDeleteFrom(final String tempBranch)
throws GitAPIException, RefAlreadyExistsException,
RefNotFoundException, InvalidRefNameException,
CheckoutConflictException, NotMergedException,
CannotDeleteCurrentBranchException {
try {
repository.reset().setMode(ResetType.HARD).call();
} finally {
try {
repository.checkout().setCreateBranch(false)
.setName(mainBranchName).setForce(true).call();
} finally {
try {
repository.reset().setMode(ResetType.HARD).call();
} finally {
repository.branchDelete().setForce(true)
.setBranchNames(tempBranch).call();
}
}
}
}
开发者ID:mast-group,
项目名称:commitmining-tools,
代码行数:33,
代码来源:RepositoryFileWalker.java
示例2: removeAllLocalBranches
点赞 2
import org.eclipse.jgit.api.errors.NotMergedException; //导入依赖的package包/类
private void removeAllLocalBranches( final Git repository )
throws GitAPIException, NotMergedException, CannotDeleteCurrentBranchException {
final String[] localBranches = repository.branchList() //
.call().stream() //
.filter( r -> r.getName() //
.startsWith( "refs/heads/" ) ) //
.map( r -> r.getName() ) //
.toArray( String[]::new ); //
repository.branchDelete() //
.setForce( true ) //
.setBranchNames( localBranches ) //
.call(); //
}
开发者ID:retest,
项目名称:rebazer,
代码行数:15,
代码来源:RebaseService.java