@@ -50,7 +50,7 @@ func (repo *Repository) GetMergeBase(ctx context.Context, tmpRemote, base, head
50
50
}
51
51
52
52
// GetCompareInfo generates and returns compare information between base and head branches of repositories.
53
- func (repo * Repository ) GetCompareInfo (basePath , baseBranch , headBranch string , directComparison , fileOnly bool ) (_ * CompareInfo , err error ) {
53
+ func (repo * Repository ) GetCompareInfo (ctx context. Context , basePath , baseBranch , headBranch string , directComparison , fileOnly bool ) (_ * CompareInfo , err error ) {
54
54
var (
55
55
remoteBranch string
56
56
tmpRemote string
@@ -77,9 +77,9 @@ func (repo *Repository) GetCompareInfo(basePath, baseBranch, headBranch string,
77
77
compareInfo .HeadCommitID = headBranch
78
78
}
79
79
80
- compareInfo .MergeBase , remoteBranch , err = repo .GetMergeBase (tmpRemote , baseBranch , headBranch )
80
+ compareInfo .MergeBase , remoteBranch , err = repo .GetMergeBase (ctx , tmpRemote , baseBranch , headBranch )
81
81
if err == nil {
82
- compareInfo .BaseCommitID , err = GetFullCommitID (repo . Ctx , repo .Path , remoteBranch )
82
+ compareInfo .BaseCommitID , err = GetFullCommitID (ctx , repo .Path , remoteBranch )
83
83
if err != nil {
84
84
compareInfo .BaseCommitID = remoteBranch
85
85
}
@@ -237,8 +237,8 @@ func (repo *Repository) GetDiff(compareArg string, w io.Writer) error {
237
237
}
238
238
239
239
// GetDiffBinary generates and returns patch data between given revisions, including binary diffs.
240
- func (repo * Repository ) GetDiffBinary (compareArg string , w io.Writer ) error {
241
- return NewCommand ("diff" , "-p" , "--binary" , "--histogram" ).AddDynamicArguments (compareArg ).Run (repo . Ctx , & RunOpts {
240
+ func (repo * Repository ) GetDiffBinary (ctx context. Context , compareArg string , w io.Writer ) error {
241
+ return NewCommand ("diff" , "-p" , "--binary" , "--histogram" ).AddDynamicArguments (compareArg ).Run (ctx , & RunOpts {
242
242
Dir : repo .Path ,
243
243
Stdout : w ,
244
244
})
0 commit comments