diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-04-18 16:37:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-18 16:37:30 +0200 |
commit | 87cc8192de93dcf7b843058f11ad85200d46bb0c (patch) | |
tree | dafcbe0c3c76881e7066c8505a8cdbf92be9f8ec /example_test.go | |
parent | b30763cb64afa91c016b23e905af0a378eb1b76d (diff) | |
parent | 6b33126e79695b499d7d519f69db4ca1ebd22dd1 (diff) | |
download | go-git-87cc8192de93dcf7b843058f11ad85200d46bb0c.tar.gz |
Merge pull request #815 from kuba--/fix-worktree/814
Fix for "Worktree Add function adds ".git" directory"
Diffstat (limited to 'example_test.go')
-rw-r--r-- | example_test.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/example_test.go b/example_test.go index e9d8e8b..ef7e3d3 100644 --- a/example_test.go +++ b/example_test.go @@ -24,12 +24,18 @@ func ExampleClone() { // Clones the repository into the worktree (fs) and storer all the .git // content into the storer - _, _ = git.Clone(storer, fs, &git.CloneOptions{ + _, err := git.Clone(storer, fs, &git.CloneOptions{ URL: "https://github.com/git-fixtures/basic.git", }) + if err != nil { + log.Fatal(err) + } // Prints the content of the CHANGELOG file from the cloned repository - changelog, _ := fs.Open("CHANGELOG") + changelog, err := fs.Open("CHANGELOG") + if err != nil { + log.Fatal(err) + } io.Copy(os.Stdout, changelog) // Output: Initial changelog |