Package org.eclipse.jgit.junit
Class TestRepository.CommitBuilder
- java.lang.Object
-
- org.eclipse.jgit.junit.TestRepository.CommitBuilder
-
- Enclosing class:
- TestRepository<R extends Repository>
public class TestRepository.CommitBuilder extends Object
Helper to generate a commit.
-
-
Method Summary
-
-
-
Method Detail
-
parent
public TestRepository.CommitBuilder parent(RevCommit p) throws Exception
set parent commit- Parameters:
p
- parent commit- Returns:
- this commit builder
- Throws:
Exception
-
noParents
public TestRepository.CommitBuilder noParents()
Remove parent commits- Returns:
- this commit builder
-
noFiles
public TestRepository.CommitBuilder noFiles()
Remove files- Returns:
- this commit builder
-
setTopLevelTree
public TestRepository.CommitBuilder setTopLevelTree(ObjectId treeId)
Set top level tree- Parameters:
treeId
- the top level tree- Returns:
- this commit builder
-
add
public TestRepository.CommitBuilder add(String path, String content) throws Exception
Add file with given content- Parameters:
path
- path of the filecontent
- the file content- Returns:
- this commit builder
- Throws:
Exception
-
add
public TestRepository.CommitBuilder add(String path, RevBlob id) throws Exception
Add file with given path and blob- Parameters:
path
- path of the fileid
- blob for this file- Returns:
- this commit builder
- Throws:
Exception
-
edit
public TestRepository.CommitBuilder edit(DirCacheEditor.PathEdit edit)
Edit the index- Parameters:
edit
- the index record update- Returns:
- this commit builder
-
rm
public TestRepository.CommitBuilder rm(String path)
Remove a file- Parameters:
path
- path of the file- Returns:
- this commit builder
-
message
public TestRepository.CommitBuilder message(String m)
Set commit message- Parameters:
m
- the message- Returns:
- this commit builder
-
message
public String message()
Get the commit message- Returns:
- the commit message
-
tick
public TestRepository.CommitBuilder tick(int secs)
Tick the clock- Parameters:
secs
- number of seconds- Returns:
- this commit builder
-
ident
public TestRepository.CommitBuilder ident(PersonIdent ident)
Set author and committer identity- Parameters:
ident
- identity to set- Returns:
- this commit builder
-
author
public TestRepository.CommitBuilder author(PersonIdent a)
Set the author identity- Parameters:
a
- the author's identity- Returns:
- this commit builder
-
author
public PersonIdent author()
Get the author identity- Returns:
- the author identity
-
committer
public TestRepository.CommitBuilder committer(PersonIdent c)
Set the committer identity- Parameters:
c
- the committer identity- Returns:
- this commit builder
-
committer
public PersonIdent committer()
Get the committer identity- Returns:
- the committer identity
-
insertChangeId
public TestRepository.CommitBuilder insertChangeId()
Insert changeId- Returns:
- this commit builder
-
insertChangeId
public TestRepository.CommitBuilder insertChangeId(String c)
Insert given changeId- Parameters:
c
- changeId- Returns:
- this commit builder
-
create
public RevCommit create() throws Exception
Create the commit- Returns:
- the new commit
- Throws:
Exception
- if creation failed
-
child
public TestRepository.CommitBuilder child() throws Exception
Create child commit builder- Returns:
- child commit builder
- Throws:
Exception
-
-