aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-06-24 00:30:29 -0700
committerGitHub <noreply@github.com>2017-06-24 00:30:29 -0700
commit7e733657d9cd931459825abf4fe71f31f0707313 (patch)
tree2efbda1618c29fe007bec46ba0b2619fdbecc22d /storage/filesystem
parentad02bf020460c210660db4fffda7f926b6aae95a (diff)
parente6da93ce9ebd39c4fb0f38a225acc996a50e03ba (diff)
downloadgo-git-7e733657d9cd931459825abf4fe71f31f0707313.tar.gz
Merge pull request #452 from taralx/patch-1
storage/filesystem: Fix nil dereference in Shallow()
Diffstat (limited to 'storage/filesystem')
-rw-r--r--storage/filesystem/shallow.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/filesystem/shallow.go b/storage/filesystem/shallow.go
index ec8d20e..107818c 100644
--- a/storage/filesystem/shallow.go
+++ b/storage/filesystem/shallow.go
@@ -36,7 +36,7 @@ func (s *ShallowStorage) SetShallow(commits []plumbing.Hash) error {
// Shallow return the shallow commits reading from shallo file from .git
func (s *ShallowStorage) Shallow() ([]plumbing.Hash, error) {
f, err := s.dir.Shallow()
- if err != nil {
+ if f == nil || err != nil {
return nil, err
}