diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-10 01:48:43 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2016-09-10 01:48:43 +0200 |
commit | 6f1d1e00a7c615209cf6b25e314d033bda3b5d09 (patch) | |
tree | 51492dae8b010a25a2116e5c8cbeadeef1fa3726 /storage/filesystem/internal/dotgit/refs.go | |
parent | e013b297b14949aadaec66deaedc130e86c30afb (diff) | |
download | go-git-6f1d1e00a7c615209cf6b25e314d033bda3b5d09.tar.gz |
storage: filesystem ref storage, and not not exists file handling
Diffstat (limited to 'storage/filesystem/internal/dotgit/refs.go')
-rw-r--r-- | storage/filesystem/internal/dotgit/refs.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/storage/filesystem/internal/dotgit/refs.go b/storage/filesystem/internal/dotgit/refs.go index ca11f6c..8f28332 100644 --- a/storage/filesystem/internal/dotgit/refs.go +++ b/storage/filesystem/internal/dotgit/refs.go @@ -81,6 +81,10 @@ func (d *DotGit) addRefsFromRefDir(refs *[]*core.Reference) error { func (d *DotGit) walkReferencesTree(refs *[]*core.Reference, relPath string) error { files, err := d.fs.ReadDir(relPath) if err != nil { + if os.IsNotExist(err) { + return nil + } + return err } @@ -110,6 +114,10 @@ func (d *DotGit) walkReferencesTree(refs *[]*core.Reference, relPath string) err func (d *DotGit) addRefFromHEAD(refs *[]*core.Reference) error { ref, err := d.readReferenceFile(".", "HEAD") if err != nil { + if os.IsNotExist(err) { + return nil + } + return err } |