@@ -365,31 +365,31 @@ func RepoSpec(ctx context.Context, urlStr string) func(c convey.C) {
365365 c .Convey ("no auth" , func () {
366366 re := client .RequestEditors
367367 client .RequestEditors = nil
368- resp , err := client .GetCommitsInRepository (ctx , userName , repoName , & api.GetCommitsInRepositoryParams {
368+ resp , err := client .GetCommitsInRef (ctx , userName , repoName , & api.GetCommitsInRefParams {
369369 RefName : utils .String (controller .DefaultBranchName ),
370370 })
371371 client .RequestEditors = re
372372 convey .So (err , convey .ShouldBeNil )
373373 convey .So (resp .StatusCode , convey .ShouldEqual , http .StatusUnauthorized )
374374 })
375375 c .Convey ("update repository in not exit repo" , func () {
376- resp , err := client .GetCommitsInRepository (ctx , userName , "happyrunfake" , & api.GetCommitsInRepositoryParams {
376+ resp , err := client .GetCommitsInRef (ctx , userName , "happyrunfake" , & api.GetCommitsInRefParams {
377377 RefName : utils .String (controller .DefaultBranchName ),
378378 })
379379 convey .So (err , convey .ShouldBeNil )
380380 convey .So (resp .StatusCode , convey .ShouldEqual , http .StatusNotFound )
381381 })
382382
383383 c .Convey ("update repository in non exit user" , func () {
384- resp , err := client .GetCommitsInRepository (ctx , "telo" , repoName , & api.GetCommitsInRepositoryParams {
384+ resp , err := client .GetCommitsInRef (ctx , "telo" , repoName , & api.GetCommitsInRefParams {
385385 RefName : utils .String (controller .DefaultBranchName ),
386386 })
387387 convey .So (err , convey .ShouldBeNil )
388388 convey .So (resp .StatusCode , convey .ShouldEqual , http .StatusNotFound )
389389 })
390390
391391 c .Convey ("update repository in other's repo" , func () {
392- resp , err := client .GetCommitsInRepository (ctx , "admin" , repoName , & api.GetCommitsInRepositoryParams {
392+ resp , err := client .GetCommitsInRef (ctx , "admin" , repoName , & api.GetCommitsInRefParams {
393393 RefName : utils .String (controller .DefaultBranchName ),
394394 })
395395 convey .So (err , convey .ShouldBeNil )
@@ -401,13 +401,13 @@ func RepoSpec(ctx context.Context, urlStr string) func(c convey.C) {
401401 uploadObject (ctx , c , client , "add rand object" , userName , repoName , controller .DefaultBranchName , "a.txt" )
402402 commitWip (ctx , c , client , "commit object" , userName , repoName , controller .DefaultBranchName , "first commit" )
403403 c .Convey ("success get commits" , func () {
404- resp , err := client .GetCommitsInRepository (ctx , userName , repoName , & api.GetCommitsInRepositoryParams {
404+ resp , err := client .GetCommitsInRef (ctx , userName , repoName , & api.GetCommitsInRefParams {
405405 RefName : utils .String (controller .DefaultBranchName ),
406406 })
407407 convey .So (err , convey .ShouldBeNil )
408408 convey .So (resp .StatusCode , convey .ShouldEqual , http .StatusOK )
409409
410- result , err := api .ParseGetCommitsInRepositoryResponse (resp )
410+ result , err := api .ParseGetCommitsInRefResponse (resp )
411411 convey .So (err , convey .ShouldBeNil )
412412 convey .So (* result .JSON200 , convey .ShouldHaveLength , 1 )
413413 convey .So ((* result .JSON200 )[0 ].Message , convey .ShouldEqual , "first commit" )
@@ -418,33 +418,33 @@ func RepoSpec(ctx context.Context, urlStr string) func(c convey.C) {
418418 uploadObject (ctx , c , client , "add third object" , userName , repoName , controller .DefaultBranchName , "c.txt" )
419419 commitWip (ctx , c , client , "commit third object" , userName , repoName , controller .DefaultBranchName , "third commit" )
420420 c .Convey ("success get commits by params" , func () {
421- resp , err := client .GetCommitsInRepository (ctx , userName , repoName , & api.GetCommitsInRepositoryParams {
421+ resp , err := client .GetCommitsInRef (ctx , userName , repoName , & api.GetCommitsInRefParams {
422422 RefName : utils .String (controller .DefaultBranchName ),
423423 })
424424 convey .So (err , convey .ShouldBeNil )
425425 convey .So (resp .StatusCode , convey .ShouldEqual , http .StatusOK )
426426
427- result , err := api .ParseGetCommitsInRepositoryResponse (resp )
427+ result , err := api .ParseGetCommitsInRefResponse (resp )
428428 convey .So (err , convey .ShouldBeNil )
429429 convey .So (* result .JSON200 , convey .ShouldHaveLength , 3 )
430430 convey .So ((* result .JSON200 )[0 ].Message , convey .ShouldEqual , "third commit" )
431431
432- newResp , err := client .GetCommitsInRepository (ctx , userName , repoName , & api.GetCommitsInRepositoryParams {
432+ newResp , err := client .GetCommitsInRef (ctx , userName , repoName , & api.GetCommitsInRefParams {
433433 After : utils .String ((* result .JSON200 )[0 ].Committer .When .Format (time .RFC3339Nano )),
434434 Amount : utils .Int (1 ),
435435 RefName : utils .String (controller .DefaultBranchName ),
436436 })
437437 convey .So (err , convey .ShouldBeNil )
438438 convey .So (resp .StatusCode , convey .ShouldEqual , http .StatusOK )
439439
440- newResult , err := api .ParseGetCommitsInRepositoryResponse (newResp )
440+ newResult , err := api .ParseGetCommitsInRefResponse (newResp )
441441 convey .So (err , convey .ShouldBeNil )
442442 convey .So (* newResult .JSON200 , convey .ShouldHaveLength , 1 )
443443 convey .So ((* newResult .JSON200 )[0 ].Message , convey .ShouldEqual , "second commit" )
444444 })
445445
446446 c .Convey ("failed get commits by wrong params" , func () {
447- resp , err := client .GetCommitsInRepository (ctx , userName , repoName , & api.GetCommitsInRepositoryParams {
447+ resp , err := client .GetCommitsInRef (ctx , userName , repoName , & api.GetCommitsInRefParams {
448448 After : utils .String ("123" ),
449449 RefName : utils .String (controller .DefaultBranchName ),
450450 })
0 commit comments