aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/shallow.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-07-19 12:59:16 +0200
committerSantiago M. Mola <santi@mola.io>2017-07-19 14:48:46 +0200
commit87888eaab1caa52b6b073f610508e0f65b4141f6 (patch)
tree1ddaa824f7baa26350aa50607877d4bf9e207f13 /storage/filesystem/shallow.go
parentebc25df06ce7d11afe88339af7bb097926599b7d (diff)
downloadgo-git-87888eaab1caa52b6b073f610508e0f65b4141f6.tar.gz
storage/filesystem: check all Close errors
Diffstat (limited to 'storage/filesystem/shallow.go')
-rw-r--r--storage/filesystem/shallow.go5
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