Update
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
main.log
|
10
main.go
10
main.go
@@ -11,6 +11,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/go-git/go-git/v5"
|
||||
"github.com/go-git/go-git/v5/plumbing/object"
|
||||
)
|
||||
|
||||
var timeUnits = map[string]int64{
|
||||
@@ -160,7 +161,14 @@ func AddAll(worktree *git.Worktree) error {
|
||||
}
|
||||
|
||||
func CommitUpdate(worktree *git.Worktree) error {
|
||||
_, err := worktree.Commit("Update", &git.CommitOptions{})
|
||||
_, err := worktree.Commit("Update", &git.CommitOptions{
|
||||
AllowEmptyCommits: false,
|
||||
Author: &object.Signature{
|
||||
Name: "system",
|
||||
Email: "system@localhost",
|
||||
When: time.Now(),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
Reference in New Issue
Block a user