(workdir, gitdir string)
| 64 | } |
| 65 | |
| 66 | func 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 | |
| 91 | func (c *Configuration) getMask() int { |
| 92 | // This logic is necessarily complex because Git's logic is complex. |
no test coverage detected