diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-07-19 22:05:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-19 22:05:00 +0200 |
commit | 2d10f1023e609894174b21bdf8d3738010099335 (patch) | |
tree | 929b050b54039af69b4eae6306429feafa9d8268 /storage/filesystem/shallow.go | |
parent | 8738a04708b91683d5804b4c648c871fdeb87f82 (diff) | |
parent | 87888eaab1caa52b6b073f610508e0f65b4141f6 (diff) | |
download | go-git-2d10f1023e609894174b21bdf8d3738010099335.tar.gz |
Merge pull request #491 from smola/error-checks
*: add more IO error checks
Diffstat (limited to 'storage/filesystem/shallow.go')
-rw-r--r-- | storage/filesystem/shallow.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/storage/filesystem/shallow.go b/storage/filesystem/shallow.go index 107818c..394e6ed 100644 --- a/storage/filesystem/shallow.go +++ b/storage/filesystem/shallow.go @@ -6,6 +6,7 @@ import ( "gopkg.in/src-d/go-git.v4/plumbing" "gopkg.in/src-d/go-git.v4/storage/filesystem/internal/dotgit" + "gopkg.in/src-d/go-git.v4/utils/ioutil" ) // ShallowStorage where the shallow commits are stored, an internal to @@ -23,14 +24,14 @@ func (s *ShallowStorage) SetShallow(commits []plumbing.Hash) error { return err } - defer f.Close() + defer ioutil.CheckClose(f, &err) for _, h := range commits { if _, err := fmt.Fprintf(f, "%s\n", h); err != err { return err } } - return nil + return err } // Shallow return the shallow commits reading from shallo file from .git |