@@ -15,7 +15,7 @@ import (
1515
1616 "github.com/bluekeyes/go-gitdiff/gitdiff"
1717 "github.com/bluekeyes/patch2pr/internal"
18- "github.com/google/go-github/v74 /github"
18+ "github.com/google/go-github/v75 /github"
1919 "github.com/shurcooL/githubv4"
2020)
2121
@@ -279,7 +279,7 @@ func createBranch(t *testing.T, tctx *TestContext) {
279279
280280 if strings .HasSuffix (d .Name (), ".bin" ) {
281281 c := base64 .StdEncoding .EncodeToString (content )
282- blob , _ , err := tctx .Client .Git .CreateBlob (tctx , tctx .Repo .Owner , tctx .Repo .Name , & github.Blob {
282+ blob , _ , err := tctx .Client .Git .CreateBlob (tctx , tctx .Repo .Owner , tctx .Repo .Name , github.Blob {
283283 Encoding : github .String ("base64" ),
284284 Content : & c ,
285285 })
@@ -308,23 +308,22 @@ func createBranch(t *testing.T, tctx *TestContext) {
308308 t .Fatalf ("error getting recursive tree: %v" , err )
309309 }
310310
311- commit := & github.Commit {
311+ commitToCreate := github.Commit {
312312 Message : github .String ("Base commit for test" ),
313313 Tree : tree ,
314314 }
315- commit , _ , err = tctx .Client .Git .CreateCommit (tctx , tctx .Repo .Owner , tctx .Repo .Name , commit , nil )
315+
316+ commit , _ , err := tctx .Client .Git .CreateCommit (tctx , tctx .Repo .Owner , tctx .Repo .Name , commitToCreate , nil )
316317 if err != nil {
317318 t .Fatalf ("error creating commit: %v" , err )
318319 }
319320
320321 tctx .BaseCommit = commit
321322 tctx .BaseTree = fullTree
322323
323- if _ , _ , err := tctx .Client .Git .CreateRef (tctx , tctx .Repo .Owner , tctx .Repo .Name , & github.Reference {
324- Ref : github .String (tctx .Branch (BaseBranch )),
325- Object : & github.GitObject {
326- SHA : commit .SHA ,
327- },
324+ if _ , _ , err := tctx .Client .Git .CreateRef (tctx , tctx .Repo .Owner , tctx .Repo .Name , github.CreateRef {
325+ Ref : tctx .Branch (BaseBranch ),
326+ SHA : commit .GetSHA (),
328327 }); err != nil {
329328 t .Fatalf ("error creating ref: %v" , err )
330329 }
0 commit comments