MCPcopy Create free account
hub / github.com/libgit2/git2go / newSignatureFromC

Function newSignatureFromC

signature.go:19–31  ·  view source on GitHub ↗
(sig *C.git_signature)

Source from the content-addressed store, hash-verified

17}
18
19func newSignatureFromC(sig *C.git_signature) *Signature {
20 if sig == nil {
21 return nil
22 }
23
24 // git stores minutes, go wants seconds
25 loc := time.FixedZone("", int(sig.when.offset)*60)
26 return &Signature{
27 C.GoString(sig.name),
28 C.GoString(sig.email),
29 time.Unix(int64(sig.when.time), 0).In(loc),
30 }
31}
32
33// Offset returns the time zone offset of v.When in minutes, which is what git wants.
34func (v *Signature) Offset() int {

Callers 8

commitCreateCallbackFunction · 0.85
DefaultSignatureMethod · 0.85
blameHunkFromCFunction · 0.85
TaggerMethod · 0.85
AuthorMethod · 0.85
CommitterMethod · 0.85
AuthorMethod · 0.85
CommitterMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…