MCPcopy Index your code
hub / github.com/go-git/go-git / main

Function main

_examples/progress/main.go:11–30  ·  view source on GitHub ↗

Example of how to show the progress when you do a basic clone operation.

()

Source from the content-addressed store, hash-verified

9
10// Example of how to show the progress when you do a basic clone operation.
11func main() {
12 CheckArgs("<url>", "<directory>")
13 url := os.Args[1]
14 directory := os.Args[2]
15
16 // Clone the given repository to the given directory
17 Info("git clone %s %s", url, directory)
18
19 _, err := git.PlainClone(directory, false, &git.CloneOptions{
20 URL: url,
21 Depth: 1,
22
23 // as git does, when you make a clone, pull or some other operations the
24 // server sends information via the sideband, this information can being
25 // collected providing a io.Writer to the CloneOptions options
26 Progress: os.Stdout,
27 })
28
29 CheckIfError(err)
30}

Callers

nothing calls this directly

Calls 3

CheckArgsFunction · 0.85
InfoFunction · 0.85
CheckIfErrorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…