MCPcopy
hub / github.com/dgraph-io/dgraph / ensureDgraphClone

Function ensureDgraphClone

dgraphtest/image.go:126–146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124}
125
126func ensureDgraphClone() error {
127 f := func() error {
128 if _, err := os.Stat(repoDir); err != nil {
129 return runGitClone()
130 }
131
132 if err := runGitStatus(); err != nil {
133 if err := os.RemoveAll(repoDir); err != nil {
134 return err
135 }
136 return runGitClone()
137 }
138 return nil
139 }
140
141 var err error
142 cloneOnce.Do(func() {
143 err = f()
144 })
145 return err
146}
147
148func runGitClone() error {
149 // The dgraph repo is already cloned for running the test. We can just create

Callers 1

setupBinaryMethod · 0.85

Calls 3

runGitCloneFunction · 0.85
runGitStatusFunction · 0.85
RemoveAllMethod · 0.80

Tested by

no test coverage detected