aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/shallow.go
diff options
context:
space:
mode:
Diffstat (limited to 'storage/filesystem/shallow.go')
-rw-r--r--storage/filesystem/shallow.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/storage/filesystem/shallow.go b/storage/filesystem/shallow.go
index 394e6ed..502d406 100644
--- a/storage/filesystem/shallow.go
+++ b/storage/filesystem/shallow.go
@@ -5,7 +5,7 @@ import (
"fmt"
"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/storage/filesystem/dotgit"
"gopkg.in/src-d/go-git.v4/utils/ioutil"
)
@@ -26,7 +26,7 @@ func (s *ShallowStorage) SetShallow(commits []plumbing.Hash) error {
defer ioutil.CheckClose(f, &err)
for _, h := range commits {
- if _, err := fmt.Fprintf(f, "%s\n", h); err != err {
+ if _, err := fmt.Fprintf(f, "%s\n", h); err != nil {
return err
}
}
@@ -41,6 +41,8 @@ func (s *ShallowStorage) Shallow() ([]plumbing.Hash, error) {
return nil, err
}
+ defer ioutil.CheckClose(f, &err)
+
var hash []plumbing.Hash
scn := bufio.NewScanner(f)