diff options
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 |