MCPcopy Create free account
hub / github.com/bluekeyes/patch2pr / idFromEnv

Function idFromEnv

cmd/patch2pr/main.go:470–477  ·  view source on GitHub ↗
(idType string)

Source from the content-addressed store, hash-verified

468}
469
470func idFromEnv(idType string) *gitdiff.PatchIdentity {
471 name, hasName := os.LookupEnv(fmt.Sprintf("GIT_%s_NAME", idType))
472 email, hasEmail := os.LookupEnv(fmt.Sprintf("GIT_%s_EMAIL", idType))
473 if hasName && hasEmail {
474 return &gitdiff.PatchIdentity{Name: name, Email: email}
475 }
476 return nil
477}
478
479func dateFromEnv(dateType string) time.Time {
480 if d, err := gitdiff.ParsePatchDate(os.Getenv(fmt.Sprintf("GIT_%s_DATE", dateType))); err == nil {

Callers 1

fillHeaderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected