|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.jgit.lib.Commit
public class Commit
Instances of this class represent a Commit object. It represents a snapshot in a Git repository, who created it and when.
| Constructor Summary | |
|---|---|
Commit(Repository db)
Create an empty commit object. |
|
Commit(Repository db,
ObjectId[] parentIds)
Create a commit associated with these parents and associate it with a repository. |
|
Commit(Repository db,
ObjectId id,
byte[] raw)
Create a commit object with the specified id and data from and existing commit object in a repository. |
|
| Method Summary | |
|---|---|
void |
commit()
Persist this commit object |
PersonIdent |
getAuthor()
|
ObjectId |
getCommitId()
|
PersonIdent |
getCommitter()
|
java.lang.String |
getEncoding()
|
java.lang.String |
getMessage()
|
ObjectId[] |
getParentIds()
|
Repository |
getRepository()
|
Tree |
getTree()
|
ObjectId |
getTreeId()
|
void |
setAuthor(PersonIdent a)
Set the author and authoring time for this commit |
void |
setCommitId(ObjectId id)
Set the id of this object. |
void |
setCommitter(PersonIdent c)
Set the committer and commit time for this object |
void |
setEncoding(java.nio.charset.Charset e)
State the encoding for the commit information |
void |
setEncoding(java.lang.String e)
State the encoding for the commit information |
void |
setMessage(java.lang.String m)
Set the commit message |
void |
setParentIds(ObjectId[] parentIds)
Set the parents of this commit |
void |
setTree(Tree t)
Set the tree object for this commit |
void |
setTreeId(ObjectId id)
Set the tree id for this commit object |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Commit(Repository db)
db - The repository with which to associate it.
public Commit(Repository db,
ObjectId[] parentIds)
db - The repository to which this commit object belongsparentIds - Id's of the parent(s)
public Commit(Repository db,
ObjectId id,
byte[] raw)
db - The repository to which this commit object belongsid - Commit idraw - Raw commit object data| Method Detail |
|---|
public Repository getRepository()
public ObjectId getCommitId()
public void setCommitId(ObjectId id)
id - the id that we calculated for this object.public ObjectId getTreeId()
getTreeId in interface Treeishpublic void setTreeId(ObjectId id)
id -
public Tree getTree()
throws java.io.IOException
getTree in interface Treeishjava.io.IOExceptionpublic void setTree(Tree t)
t - the Tree objectsetTreeId(org.eclipse.jgit.lib.ObjectId)public PersonIdent getAuthor()
public void setAuthor(PersonIdent a)
a - public PersonIdent getCommitter()
public void setCommitter(PersonIdent c)
c - the committer informationpublic ObjectId[] getParentIds()
public java.lang.String getMessage()
public void setParentIds(ObjectId[] parentIds)
parentIds - public void setMessage(java.lang.String m)
m - the commit message
public void commit()
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic void setEncoding(java.lang.String e)
e - the encoding. See Charsetpublic void setEncoding(java.nio.charset.Charset e)
e - the encoding. See Charsetpublic java.lang.String getEncoding()
Charset
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||