@@ -27,8 +27,8 @@ const (
2727)
2828
2929// GetRawDiff dumps diff results of repository in given commit ID to io.Writer.
30- func GetRawDiff (repo * Repository , commitID string , diffType RawDiffType , writer io.Writer ) error {
31- return GetRepoRawDiffForFile (repo , "" , commitID , diffType , "" , writer )
30+ func GetRawDiff (ctx context. Context , repo * Repository , commitID string , diffType RawDiffType , writer io.Writer ) error {
31+ return GetRepoRawDiffForFile (ctx , repo , "" , commitID , diffType , "" , writer )
3232}
3333
3434// GetReverseRawDiff dumps the reverse diff results of repository in given commit ID to io.Writer.
@@ -46,7 +46,7 @@ func GetReverseRawDiff(ctx context.Context, repoPath, commitID string, writer io
4646}
4747
4848// GetRepoRawDiffForFile dumps diff results of file in given commit ID to io.Writer according given repository
49- func GetRepoRawDiffForFile (repo * Repository , startCommit , endCommit string , diffType RawDiffType , file string , writer io.Writer ) error {
49+ func GetRepoRawDiffForFile (ctx context. Context , repo * Repository , startCommit , endCommit string , diffType RawDiffType , file string , writer io.Writer ) error {
5050 commit , err := repo .GetCommit (endCommit )
5151 if err != nil {
5252 return err
@@ -89,7 +89,7 @@ func GetRepoRawDiffForFile(repo *Repository, startCommit, endCommit string, diff
8989 }
9090
9191 stderr := new (bytes.Buffer )
92- if err = cmd .Run (repo . Ctx , & RunOpts {
92+ if err = cmd .Run (ctx , & RunOpts {
9393 Dir : repo .Path ,
9494 Stdout : writer ,
9595 Stderr : stderr ,
0 commit comments