MCPcopy
hub / github.com/git-lfs/git-lfs / NewIn

Function NewIn

config/config.go:66–89  ·  view source on GitHub ↗
(workdir, gitdir string)

Source from the content-addressed store, hash-verified

64}
65
66func NewIn(workdir, gitdir string) *Configuration {
67 gitConf := git.NewConfig(workdir, gitdir)
68 c := &Configuration{
69 Os: EnvironmentOf(NewOsFetcher()),
70 gitConfig: gitConf,
71 timestamp: time.Now(),
72 }
73
74 if len(gitConf.WorkDir) > 0 {
75 c.gitDir = &gitConf.GitDir
76 c.workDir = gitConf.WorkDir
77 }
78
79 c.Git = &delayedEnvironment{
80 callback: func() Environment {
81 sources, err := gitConf.Sources(c.LocalWorkingDir(), ".lfsconfig")
82 if err != nil {
83 fmt.Fprintln(os.Stderr, tr.Tr.Get("Error reading `git config`: %s", err))
84 }
85 return c.readGitConfig(sources...)
86 },
87 }
88 return c
89}
90
91func (c *Configuration) getMask() int {
92 // This logic is necessarily complex because Git's logic is complex.

Callers 4

newRepoFunction · 0.92
WrapRepoFunction · 0.92
newHandlerFunction · 0.92
NewFunction · 0.85

Calls 7

LocalWorkingDirMethod · 0.95
readGitConfigMethod · 0.95
NewConfigFunction · 0.92
EnvironmentOfFunction · 0.85
NewOsFetcherFunction · 0.85
SourcesMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected