Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 7e73365

Browse files
authored
Merge pull request #452 from taralx/patch-1
storage/filesystem: Fix nil dereference in Shallow()
2 parents ad02bf0 + e6da93c commit 7e73365

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

storage/filesystem/shallow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func (s *ShallowStorage) SetShallow(commits []plumbing.Hash) error {
3636
// Shallow return the shallow commits reading from shallo file from .git
3737
func (s *ShallowStorage) Shallow() ([]plumbing.Hash, error) {
3838
f, err := s.dir.Shallow()
39-
if err != nil {
39+
if f == nil || err != nil {
4040
return nil, err
4141
}
4242

0 commit comments

Comments
 (0)