@@ -37,8 +37,8 @@ func (c *Commit) Summary() string {
3737 return strings .Split (c .Message , "\n " )[0 ]
3838}
3939
40- // ParentsCount returns number of parents of the commit.
41- // It returns 0 if this is the root commit, otherwise returns 1, 2, etc.
40+ // ParentsCount returns number of parents of the commit. It returns 0 if this is
41+ // the root commit, otherwise returns 1, 2, etc.
4242func (c * Commit ) ParentsCount () int {
4343 return len (c .parents )
4444}
@@ -52,8 +52,8 @@ func (c *Commit) ParentID(n int) (*SHA1, error) {
5252 return c .parents [n ], nil
5353}
5454
55- // Parent returns the n-th parent commit (0-based) of this commit.
56- // It returns ErrRevisionNotExist if no such parent exists.
55+ // Parent returns the n-th parent commit (0-based) of this commit. It returns
56+ // ErrRevisionNotExist if no such parent exists.
5757func (c * Commit ) Parent (n int , opts ... CatFileCommitOptions ) (* Commit , error ) {
5858 id , err := c .ParentID (n )
5959 if err != nil {
@@ -68,14 +68,14 @@ func (c *Commit) CommitByPath(opts ...CommitByRevisionOptions) (*Commit, error)
6868 return c .repo .CommitByRevision (c .ID .String (), opts ... )
6969}
7070
71- // CommitsByPage returns a paginated list of commits in the state of this commit.
72- // The returned list is in reverse chronological order.
71+ // CommitsByPage returns a paginated list of commits in the state of this
72+ // commit. The returned list is in reverse chronological order.
7373func (c * Commit ) CommitsByPage (page , size int , opts ... CommitsByPageOptions ) ([]* Commit , error ) {
7474 return c .repo .CommitsByPage (c .ID .String (), page , size , opts ... )
7575}
7676
77- // SearchCommits searches commit message with given pattern. The returned list is in reverse
78- // chronological order.
77+ // SearchCommits searches commit message with given pattern. The returned list
78+ // is in reverse chronological order.
7979func (c * Commit ) SearchCommits (pattern string , opts ... SearchCommitsOptions ) ([]* Commit , error ) {
8080 return c .repo .SearchCommits (c .ID .String (), pattern , opts ... )
8181}
@@ -90,18 +90,19 @@ func (c *Commit) CommitsCount(opts ...RevListCountOptions) (int64, error) {
9090 return c .repo .RevListCount ([]string {c .ID .String ()}, opts ... )
9191}
9292
93- // FilesChangedSince returns a list of files changed after given commit ID.
93+ // FilesChangedAfter returns a list of files changed after given commit ID.
9494func (c * Commit ) FilesChangedAfter (after string , opts ... DiffNameOnlyOptions ) ([]string , error ) {
9595 return c .repo .DiffNameOnly (after , c .ID .String (), opts ... )
9696}
9797
98- // CommitsAfter returns a list of commits after given commit ID up to this commit. The returned
99- // list is in reverse chronological order.
98+ // CommitsAfter returns a list of commits after given commit ID up to this
99+ // commit. The returned list is in reverse chronological order.
100100func (c * Commit ) CommitsAfter (after string , opts ... RevListOptions ) ([]* Commit , error ) {
101101 return c .repo .RevList ([]string {after + "..." + c .ID .String ()}, opts ... )
102102}
103103
104- // Ancestors returns a list of ancestors of this commit in reverse chronological order.
104+ // Ancestors returns a list of ancestors of this commit in reverse chronological
105+ // order.
105106func (c * Commit ) Ancestors (opts ... LogOptions ) ([]* Commit , error ) {
106107 if c .ParentsCount () == 0 {
107108 return []* Commit {}, nil
@@ -166,7 +167,8 @@ func (c *Commit) IsImageFile(subpath string) (bool, error) {
166167 return c .isImageFile (c .Blob (subpath ))
167168}
168169
169- // IsImageFileByIndex returns true if the blob of the commit is an image by index.
170+ // IsImageFileByIndex returns true if the blob of the commit is an image by
171+ // index.
170172func (c * Commit ) IsImageFileByIndex (index string ) (bool , error ) {
171173 return c .isImageFile (c .BlobByIndex (index ))
172174}
0 commit comments