This commit is contained in:
2024-07-20 18:58:30 +02:00
parent 37e2321551
commit 3f2f961791
2 changed files with 177 additions and 168 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
main.log

10
main.go
View File

@@ -11,6 +11,7 @@ import (
"time" "time"
"github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/object"
) )
var timeUnits = map[string]int64{ var timeUnits = map[string]int64{
@@ -160,7 +161,14 @@ func AddAll(worktree *git.Worktree) error {
} }
func CommitUpdate(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 { if err != nil {
return err return err
} }