@@ -77,11 +77,11 @@ func TestResolveTag(t *testing.T) {
77
77
func TestSortedCommitTags (t * testing.T ) {
78
78
// Create a folder for the test repository.
79
79
repositoryPath , err := paths .TempDir ().MkTempDir ("gitutils-TestSortedTags-repo" )
80
- require .Nil (t , err )
80
+ require .NoError (t , err )
81
81
82
82
// Create test repository.
83
83
repository , err := git .PlainInit (repositoryPath .String (), false )
84
- require .Nil (t , err )
84
+ require .NoError (t , err )
85
85
86
86
var tags []* plumbing.Reference
87
87
tags = append (tags , makeTag (t , repository , "1.0.0" , makeCommit (t , repository , repositoryPath ), true ))
@@ -90,24 +90,15 @@ func TestSortedCommitTags(t *testing.T) {
90
90
tags = append (tags , makeTag (t , repository , "1.0.1" , makeCommit (t , repository , repositoryPath ), false ))
91
91
92
92
worktree , err := repository .Worktree ()
93
- require .Nil (t , err )
94
- worktree .Checkout (
95
- & git.CheckoutOptions {
96
- Branch : "development-branch" ,
97
- Create : true ,
98
- },
99
- )
93
+ require .NoError (t , err )
94
+ require .NoError (t , worktree .Checkout (& git.CheckoutOptions {Branch : "development-branch" , Create : true }))
95
+
100
96
var branchTags []* plumbing.Reference
101
97
branchTags = append (branchTags , makeTag (t , repository , "1.0.2-rc1" , makeCommit (t , repository , repositoryPath ), true ))
102
98
branchTags = append (branchTags , makeTag (t , repository , "1.0.2-rc2" , makeCommit (t , repository , repositoryPath ), true ))
103
99
config , err := repository .Config ()
104
- require .Nil (t , err )
105
- worktree .Checkout (
106
- & git.CheckoutOptions {
107
- Branch : plumbing .ReferenceName (config .Init .DefaultBranch ),
108
- Create : false ,
109
- },
110
- )
100
+ require .NoError (t , err )
101
+ require .NoError (t , worktree .Checkout (& git.CheckoutOptions {Branch : plumbing .ReferenceName (config .Init .DefaultBranch ), Create : false }))
111
102
112
103
tags = append (tags , makeTag (t , repository , "1.0.2" , makeCommit (t , repository , repositoryPath ), true ))
113
104
// Throw a blob tag into the mix. This should not have any effect.
0 commit comments