aboutsummaryrefslogtreecommitdiffstats
path: root/submodule.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-09-01 17:26:52 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2017-09-01 17:26:52 +0200
commitf1e58e0d30095cf768ff04d379b5e4145a874be8 (patch)
tree1922e3a721c4c19889557f96108076c325b95fbd /submodule.go
parent3ca370277427c5d508f0dedacbd559523a305121 (diff)
downloadgo-git-f1e58e0d30095cf768ff04d379b5e4145a874be8.tar.gz
Worktree.Reset ignore untracked files on Merge 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 {