java.lang.Object
org.eclipse.jgit.junit.TestRepository.BranchBuilder
- Enclosing class:
- TestRepository<R extends org.eclipse.jgit.lib.Repository>
Helper to build a branch with one or more commits
-
Method Summary
Modifier and TypeMethodDescriptioncommit()Create commit buildervoiddelete()Delete this branch.org.eclipse.jgit.revwalk.RevCommitForcefully update this branch to a particular commit.org.eclipse.jgit.revwalk.RevCommitupdate(org.eclipse.jgit.revwalk.RevCommit to) Forcefully update this branch to a particular commit.
-
Method Details
-
commit
Create commit builder- Returns:
- construct a new commit builder that updates this branch. If the branch already exists, the commit builder will have its first parent as the current commit and its tree will be initialized to the current files.
- Throws:
Exception- the commit builder can't read the current branch state
-
update
public org.eclipse.jgit.revwalk.RevCommit update(TestRepository<R>.CommitBuilder to) throws Exception Forcefully update this branch to a particular commit.- Parameters:
to- the commit to update to.- Returns:
to.- Throws:
Exception- if an error occurred
-
update
public org.eclipse.jgit.revwalk.RevCommit update(org.eclipse.jgit.revwalk.RevCommit to) throws Exception Forcefully update this branch to a particular commit.- Parameters:
to- the commit to update to.- Returns:
to.- Throws:
Exception- if an error occurred
-
delete
Delete this branch.- Throws:
Exception- if an error occurred- Since:
- 4.4
-