MCPcopy Create free account
hub / github.com/go-git/go-git / getSubmodulesStatus

Method getSubmodulesStatus

worktree_status.go:185–208  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183}
184
185func (w *Worktree) getSubmodulesStatus() (map[string]plumbing.Hash, error) {
186 o := map[string]plumbing.Hash{}
187
188 sub, err := w.Submodules()
189 if err != nil {
190 return nil, err
191 }
192
193 status, err := sub.Status()
194 if err != nil {
195 return nil, err
196 }
197
198 for _, s := range status {
199 if s.Current.IsZero() {
200 o[s.Path] = s.Expected
201 continue
202 }
203
204 o[s.Path] = s.Current
205 }
206
207 return o, nil
208}
209
210func (w *Worktree) diffCommitWithStaging(commit plumbing.Hash, reverse bool) (merkletrie.Changes, error) {
211 var t *object.Tree

Callers 1

Calls 3

SubmodulesMethod · 0.95
IsZeroMethod · 0.65
StatusMethod · 0.45

Tested by

no test coverage detected