diff options
Diffstat (limited to '_examples')
-rw-r--r-- | _examples/README.md | 1 | ||||
-rw-r--r-- | _examples/checkout/main.go | 5 | ||||
-rw-r--r-- | _examples/common.go | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/_examples/README.md b/_examples/README.md index d6f3e55..9473a06 100644 --- a/_examples/README.md +++ b/_examples/README.md @@ -10,6 +10,7 @@ Here you can find a list of annotated _go-git_ examples: - [remotes](remotes/main.go) - Working with remotes: adding, removing, etc - [progress](progress/main.go) - Printing the progress information from the sideband - [push](push/main.go) - Push repository to default remote (origin) +- [checkout](checkout/main.go) - check out a specific commit from a repository. ### Advanced - [custom_http](custom_http/main.go) - Replacing the HTTP client using a custom one - [storage](storage/README.md) - Implementing a custom storage system diff --git a/_examples/checkout/main.go b/_examples/checkout/main.go index 3282f14..24f926a 100644 --- a/_examples/checkout/main.go +++ b/_examples/checkout/main.go @@ -15,11 +15,10 @@ func main() { url, directory, commitRef := os.Args[1], os.Args[2], os.Args[3] // Clone the given repository to the given directory - Info("git clone %s %s --recursive", url, directory) + Info("git clone %s %s", url, directory) r, err := git.PlainClone(directory, false, &git.CloneOptions{ - URL: url, - RecurseSubmodules: git.DefaultSubmoduleRecursionDepth, + URL: url, }) CheckIfError(err) diff --git a/_examples/common.go b/_examples/common.go index c4618ae..2719c0e 100644 --- a/_examples/common.go +++ b/_examples/common.go @@ -6,7 +6,7 @@ import ( "strings" ) -// CheckArgs should be uesed to esnure the right command line arguments are +// CheckArgs should be used to esnure the right command line arguments are // passed before executing an example. func CheckArgs(arg ...string) { if len(os.Args) < len(arg)+1 { @@ -15,7 +15,7 @@ func CheckArgs(arg ...string) { } } -// CheckIfError should be used to naiivly panics if an error is not nil. +// CheckIfError should be used to naively panics if an error is not nil. func CheckIfError(err error) { if err == nil { return |