@@ -34,11 +34,11 @@ type Branch struct {
3434}
3535
3636// GetHEADBranch returns corresponding branch of HEAD.
37- func (repo * Repository ) GetHEADBranch () (* Branch , error ) {
37+ func (repo * Repository ) GetHEADBranch (ctx context. Context ) (* Branch , error ) {
3838 if repo == nil {
3939 return nil , fmt .Errorf ("nil repo" )
4040 }
41- stdout , _ , err := NewCommand ("symbolic-ref" , "HEAD" ).RunStdString (repo . Ctx , & RunOpts {Dir : repo .Path })
41+ stdout , _ , err := NewCommand ("symbolic-ref" , "HEAD" ).RunStdString (ctx , & RunOpts {Dir : repo .Path })
4242 if err != nil {
4343 return nil , err
4444 }
@@ -104,7 +104,7 @@ type DeleteBranchOptions struct {
104104}
105105
106106// DeleteBranch delete a branch by name on repository.
107- func (repo * Repository ) DeleteBranch (name string , opts DeleteBranchOptions ) error {
107+ func (repo * Repository ) DeleteBranch (ctx context. Context , name string , opts DeleteBranchOptions ) error {
108108 cmd := NewCommand ("branch" )
109109
110110 if opts .Force {
@@ -114,17 +114,17 @@ func (repo *Repository) DeleteBranch(name string, opts DeleteBranchOptions) erro
114114 }
115115
116116 cmd .AddDashesAndList (name )
117- _ , _ , err := cmd .RunStdString (repo . Ctx , & RunOpts {Dir : repo .Path })
117+ _ , _ , err := cmd .RunStdString (ctx , & RunOpts {Dir : repo .Path })
118118
119119 return err
120120}
121121
122122// CreateBranch create a new branch
123- func (repo * Repository ) CreateBranch (branch , oldbranchOrCommit string ) error {
123+ func (repo * Repository ) CreateBranch (ctx context. Context , branch , oldbranchOrCommit string ) error {
124124 cmd := NewCommand ("branch" )
125125 cmd .AddDashesAndList (branch , oldbranchOrCommit )
126126
127- _ , _ , err := cmd .RunStdString (repo . Ctx , & RunOpts {Dir : repo .Path })
127+ _ , _ , err := cmd .RunStdString (ctx , & RunOpts {Dir : repo .Path })
128128
129129 return err
130130}
0 commit comments