aboutsummaryrefslogtreecommitdiffstats
path: root/submodule.go
diff options
context:
space:
mode:
Diffstat (limited to 'submodule.go')
-rw-r--r--submodule.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/submodule.go b/submodule.go
index fd3d173..de8ac73 100644
--- a/submodule.go
+++ b/submodule.go
@@ -62,14 +62,17 @@ func (s *Submodule) Status() (*SubmoduleStatus, error) {
}
func (s *Submodule) status(idx *index.Index) (*SubmoduleStatus, error) {
+ status := &SubmoduleStatus{
+ Path: s.c.Path,
+ }
+
e, err := idx.Entry(s.c.Path)
- if err != nil {
+ if err != nil && err != index.ErrEntryNotFound {
return nil, err
}
- status := &SubmoduleStatus{
- Path: s.c.Path,
- Expected: e.Hash,
+ if e != nil {
+ status.Expected = e.Hash
}
if !s.initialized {