Package org.eclipse.jgit.junit
Class TestRepository.BranchBuilder
- java.lang.Object
-
- org.eclipse.jgit.junit.TestRepository.BranchBuilder
-
- Enclosing class:
- TestRepository<R extends Repository>
public class TestRepository.BranchBuilder extends java.lang.Object
Helper to build a branch with one or more commits
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
ref
-
Constructor Summary
Constructors Constructor Description BranchBuilder(java.lang.String ref)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TestRepository.CommitBuilder
commit()
void
delete()
Delete this branch.RevCommit
update(TestRepository.CommitBuilder to)
Forcefully update this branch to a particular commit.RevCommit
update(RevCommit to)
Forcefully update this branch to a particular commit.
-
-
-
Method Detail
-
commit
public TestRepository.CommitBuilder commit() throws java.lang.Exception
- 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:
java.lang.Exception
- the commit builder can't read the current branch state
-
update
public RevCommit update(TestRepository.CommitBuilder to) throws java.lang.Exception
Forcefully update this branch to a particular commit.- Parameters:
to
- the commit to update to.- Returns:
to
.- Throws:
java.lang.Exception
-
update
public RevCommit update(RevCommit to) throws java.lang.Exception
Forcefully update this branch to a particular commit.- Parameters:
to
- the commit to update to.- Returns:
to
.- Throws:
java.lang.Exception
-
delete
public void delete() throws java.lang.Exception
Delete this branch.- Throws:
java.lang.Exception
- Since:
- 4.4
-
-