File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 11package version
22
33import (
4- "io/ioutil "
4+ "os "
55 "testing"
66 "time"
77
@@ -12,7 +12,7 @@ import (
1212
1313func TestGitDescribe (t * testing.T ) {
1414 assert := assert .New (t )
15- dir , _ := ioutil . TempDir ("" , "example" )
15+ dir , _ := os . MkdirTemp ("" , "example" )
1616 repo , err := git .PlainInit (dir , false )
1717 assert .NoError (err )
1818
@@ -31,7 +31,11 @@ func TestGitDescribe(t *testing.T) {
3131 Email : "john@doe.org" ,
3232 When : now ,
3333 }
34- opts := git.CommitOptions {Author : author , Committer : author }
34+ opts := git.CommitOptions {
35+ Author : author ,
36+ Committer : author ,
37+ AllowEmptyCommits : true ,
38+ }
3539
3640 commit1 , err := worktree .Commit ("first commit" , & opts )
3741 assert .NoError (err )
@@ -93,7 +97,7 @@ func TestGitDescribe(t *testing.T) {
9397
9498func TestGitDescribeError (t * testing.T ) {
9599 assert := assert .New (t )
96- dir , _ := ioutil . TempDir ("" , "example" )
100+ dir , _ := os . MkdirTemp ("" , "example" )
97101
98102 test := func (msg string ) {
99103 head , err := GitDescribe (dir )
You can’t perform that action at this time.
0 commit comments