MCPcopy Index your code
hub / github.com/go-git/go-git / Init

Method Init

submodule.go:42–57  ·  view source on GitHub ↗

Init initialize the submodule reading the recorded Entry in the index for the given submodule

()

Source from the content-addressed store, hash-verified

40// Init initialize the submodule reading the recorded Entry in the index for
41// the given submodule
42func (s *Submodule) Init() error {
43 cfg, err := s.w.r.Config()
44 if err != nil {
45 return err
46 }
47
48 _, ok := cfg.Submodules[s.c.Name]
49 if ok {
50 return ErrSubmoduleAlreadyInitialized
51 }
52
53 s.initialized = true
54
55 cfg.Submodules[s.c.Name] = s.c
56 return s.w.r.Storer.SetConfig(cfg)
57}
58
59// Status returns the status of the submodule.
60func (s *Submodule) Status() (*SubmoduleStatus, error) {

Callers 1

updateMethod · 0.95

Calls 2

ConfigMethod · 0.65
SetConfigMethod · 0.65

Tested by

no test coverage detected