@@ -190,8 +190,8 @@ func (repo *Repository) searchCommits(ctx context.Context, id ObjectID, opts Sea
190190
191191// FileChangedBetweenCommits Returns true if the file changed between commit IDs id1 and id2
192192// You must ensure that id1 and id2 are valid commit ids.
193- func (repo * Repository ) FileChangedBetweenCommits (filename , id1 , id2 string ) (bool , error ) {
194- stdout , _ , err := NewCommand ("diff" , "--name-only" , "-z" ).AddDynamicArguments (id1 , id2 ).AddDashesAndList (filename ).RunStdBytes (repo . Ctx , & RunOpts {Dir : repo .Path })
193+ func (repo * Repository ) FileChangedBetweenCommits (ctx context. Context , filename , id1 , id2 string ) (bool , error ) {
194+ stdout , _ , err := NewCommand ("diff" , "--name-only" , "-z" ).AddDynamicArguments (id1 , id2 ).AddDashesAndList (filename ).RunStdBytes (ctx , & RunOpts {Dir : repo .Path })
195195 if err != nil {
196196 return false , err
197197 }
@@ -216,7 +216,7 @@ type CommitsByFileAndRangeOptions struct {
216216}
217217
218218// CommitsByFileAndRange return the commits according revision file and the page
219- func (repo * Repository ) CommitsByFileAndRange (opts CommitsByFileAndRangeOptions ) ([]* Commit , error ) {
219+ func (repo * Repository ) CommitsByFileAndRange (ctx context. Context , opts CommitsByFileAndRangeOptions ) ([]* Commit , error ) {
220220 stdoutReader , stdoutWriter := io .Pipe ()
221221 defer func () {
222222 _ = stdoutReader .Close ()
@@ -234,7 +234,7 @@ func (repo *Repository) CommitsByFileAndRange(opts CommitsByFileAndRangeOptions)
234234 }
235235
236236 gitCmd .AddDashesAndList (opts .File )
237- err := gitCmd .Run (repo . Ctx , & RunOpts {
237+ err := gitCmd .Run (ctx , & RunOpts {
238238 Dir : repo .Path ,
239239 Stdout : stdoutWriter ,
240240 Stderr : & stderr ,
0 commit comments