mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-24 01:24:39 +02:00
Update code.gitea.io/git (#3137)
This commit is contained in:
1 parent
682ac11958
commit
58a7de2aea
31 files changed
+3274
-405
No files matched your search
+6
-1
@@ -17,6 +17,11 @@ type Signature struct {
|
||||
When time.Time
|
||||
}
|
||||
|
||||
const (
|
||||
// GitTimeLayout is the (default) time layout used by git.
|
||||
GitTimeLayout = "Mon Jan _2 15:04:05 2006 -0700"
|
||||
)
|
||||
|
||||
// Helper to get a signature from the commit line, which looks like these:
|
||||
// author Patrick Gundlach <gundlach@speedata.de> 1378823654 +0200
|
||||
// author Patrick Gundlach <gundlach@speedata.de> Thu, 07 Apr 2005 22:13:13 +0200
|
||||
@@ -40,7 +45,7 @@ func newSignatureFromCommitline(line []byte) (_ *Signature, err error) {
|
||||
seconds, _ := strconv.ParseInt(timestring, 10, 64)
|
||||
sig.When = time.Unix(seconds, 0)
|
||||
} else {
|
||||
sig.When, err = time.Parse("Mon Jan _2 15:04:05 2006 -0700", string(line[emailEnd+2:]))
|
||||
sig.When, err = time.Parse(GitTimeLayout, string(line[emailEnd+2:]))
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user