[英]Why are my commits via go-git dated 1970?
我正在通过 go-git 提交更改:
import (
"github.com/tcnksm/go-gitconfig"
"github.com/walterjwhite/go-application/libraries/logging"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/object"
)
func stackoverflowCommit(R *git.Repository, W *git.Worktree) {
username, err := gitconfig.Username()
logging.Panic(err)
email, err := gitconfig.Email()
logging.Panic(err)
_, err = W.Commit("commit message goes here", &git.CommitOptions{Author: &object.Signature{Name: username, Email: email}})
logging.Panic(err)
}
在我的日志中,我看到了这个:
Date: Thu Jan 1 00:00:00 1970 +0000
这是预期的行为吗? 反正我不认为我可以通过约会。 对源代码的快速检查显示 Commit 对象没有任何迄今为止的引用......
是这样,还是我错过了什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.