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

Method updateRemoteConfigIfNeeded

repository.go:1049–1063  ·  view source on GitHub ↗
(o *CloneOptions, c *config.RemoteConfig, _ *plumbing.Reference)

Source from the content-addressed store, hash-verified

1047}
1048
1049func (r *Repository) updateRemoteConfigIfNeeded(o *CloneOptions, c *config.RemoteConfig, _ *plumbing.Reference) error {
1050 if !o.SingleBranch {
1051 return nil
1052 }
1053
1054 c.Fetch = r.cloneRefSpec(o)
1055
1056 cfg, err := r.Config()
1057 if err != nil {
1058 return err
1059 }
1060
1061 cfg.Remotes[c.Name] = c
1062 return r.Storer.SetConfig(cfg)
1063}
1064
1065func (r *Repository) fetchAndUpdateReferences(
1066 ctx context.Context, o *FetchOptions, ref plumbing.ReferenceName,

Callers 1

cloneMethod · 0.95

Calls 3

cloneRefSpecMethod · 0.95
ConfigMethod · 0.95
SetConfigMethod · 0.65

Tested by

no test coverage detected