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

Method Init

submodule.go:39–54  ·  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

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

Callers 1

updateMethod · 0.95

Calls 2

ConfigMethod · 0.65
SetConfigMethod · 0.65

Tested by

no test coverage detected