@@ -37,8 +37,8 @@ func (c *Commit) Summary() string {
37
37
return strings .Split (c .Message , "\n " )[0 ]
38
38
}
39
39
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.
42
42
func (c * Commit ) ParentsCount () int {
43
43
return len (c .parents )
44
44
}
@@ -52,8 +52,8 @@ func (c *Commit) ParentID(n int) (*SHA1, error) {
52
52
return c .parents [n ], nil
53
53
}
54
54
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.
57
57
func (c * Commit ) Parent (n int , opts ... CatFileCommitOptions ) (* Commit , error ) {
58
58
id , err := c .ParentID (n )
59
59
if err != nil {
@@ -68,14 +68,14 @@ func (c *Commit) CommitByPath(opts ...CommitByRevisionOptions) (*Commit, error)
68
68
return c .repo .CommitByRevision (c .ID .String (), opts ... )
69
69
}
70
70
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.
73
73
func (c * Commit ) CommitsByPage (page , size int , opts ... CommitsByPageOptions ) ([]* Commit , error ) {
74
74
return c .repo .CommitsByPage (c .ID .String (), page , size , opts ... )
75
75
}
76
76
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.
79
79
func (c * Commit ) SearchCommits (pattern string , opts ... SearchCommitsOptions ) ([]* Commit , error ) {
80
80
return c .repo .SearchCommits (c .ID .String (), pattern , opts ... )
81
81
}
@@ -90,18 +90,19 @@ func (c *Commit) CommitsCount(opts ...RevListCountOptions) (int64, error) {
90
90
return c .repo .RevListCount ([]string {c .ID .String ()}, opts ... )
91
91
}
92
92
93
- // FilesChangedSince returns a list of files changed after given commit ID.
93
+ // FilesChangedAfter returns a list of files changed after given commit ID.
94
94
func (c * Commit ) FilesChangedAfter (after string , opts ... DiffNameOnlyOptions ) ([]string , error ) {
95
95
return c .repo .DiffNameOnly (after , c .ID .String (), opts ... )
96
96
}
97
97
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.
100
100
func (c * Commit ) CommitsAfter (after string , opts ... RevListOptions ) ([]* Commit , error ) {
101
101
return c .repo .RevList ([]string {after + "..." + c .ID .String ()}, opts ... )
102
102
}
103
103
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.
105
106
func (c * Commit ) Ancestors (opts ... LogOptions ) ([]* Commit , error ) {
106
107
if c .ParentsCount () == 0 {
107
108
return []* Commit {}, nil
@@ -166,7 +167,8 @@ func (c *Commit) IsImageFile(subpath string) (bool, error) {
166
167
return c .isImageFile (c .Blob (subpath ))
167
168
}
168
169
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.
170
172
func (c * Commit ) IsImageFileByIndex (index string ) (bool , error ) {
171
173
return c .isImageFile (c .BlobByIndex (index ))
172
174
}
0 commit comments