File tree 1 file changed +13
-6
lines changed
1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -459,12 +459,19 @@ func TestPipelineHeadCommit(t *testing.T) {
459
459
assert .False (t , out .CreatedBranchHash .IsZero ())
460
460
461
461
pipeline := NewPipeline (repo )
462
- pipeline .Branch = testBranch
463
- commits , err := pipeline .HeadCommit ()
464
- assert .NoError (t , err )
465
- assert .Len (t , commits , 1 )
466
- assert .True (t , len (commits [0 ].ParentHashes ) > 0 )
467
- assert .Equal (t , out .CreatedBranchHash , commits [0 ].Hash )
462
+ t .Run ("branch ok" , func (t * testing.T ) {
463
+ pipeline .Branch = testBranch
464
+ commits , err := pipeline .HeadCommit ()
465
+ assert .NoError (t , err )
466
+ assert .Len (t , commits , 1 )
467
+ assert .True (t , len (commits [0 ].ParentHashes ) > 0 )
468
+ assert .Equal (t , out .CreatedBranchHash , commits [0 ].Hash )
469
+ })
470
+ t .Run ("branch does not exist" , func (t * testing.T ) {
471
+ pipeline .Branch = "not-a-branch"
472
+ _ , err := pipeline .HeadCommit ()
473
+ assert .Error (t , err )
474
+ })
468
475
})
469
476
}
470
477
You can’t perform that action at this time.
0 commit comments