MCPcopy
hub / github.com/go-git/go-git / getSubmodulesStatus

Method getSubmodulesStatus

worktree_status.go:202–225  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

200}
201
202func (w *Worktree) getSubmodulesStatus() (map[string]plumbing.Hash, error) {
203 o := map[string]plumbing.Hash{}
204
205 sub, err := w.Submodules()
206 if err != nil {
207 return nil, err
208 }
209
210 status, err := sub.Status()
211 if err != nil {
212 return nil, err
213 }
214
215 for _, s := range status {
216 if s.Current.IsZero() {
217 o[s.Path] = s.Expected
218 continue
219 }
220
221 o[s.Path] = s.Current
222 }
223
224 return o, nil
225}
226
227func (w *Worktree) diffCommitWithStaging(commit plumbing.Hash, reverse bool) (merkletrie.Changes, error) {
228 var t *object.Tree

Callers 1

Calls 3

SubmodulesMethod · 0.95
IsZeroMethod · 0.65
StatusMethod · 0.45

Tested by

no test coverage detected