MCPcopy Create free account
hub / github.com/cogentcore/core / commitToVCS

Method commitToVCS

filetree/vcs.go:160–175  ·  view source on GitHub ↗

commitToVCS commits file changes to version control system

(message string)

Source from the content-addressed store, hash-verified

158
159// commitToVCS commits file changes to version control system
160func (fn *Node) commitToVCS(message string) (err error) {
161 repo, _ := fn.Repo()
162 if repo == nil {
163 return
164 }
165 if fn.Info.VCS == vcs.Untracked {
166 return errors.New("file not in vcs repo: " + string(fn.Filepath))
167 }
168 err = repo.CommitFile(string(fn.Filepath), message)
169 if err != nil {
170 return err
171 }
172 fn.Info.VCS = vcs.Stored
173 fn.NeedsRender()
174 return err
175}
176
177// revertVCSSelected removes selected files from version control system
178func (fn *Node) revertVCSSelected() { //types:add

Callers

nothing calls this directly

Calls 4

RepoMethod · 0.95
NewFunction · 0.92
NeedsRenderMethod · 0.80
CommitFileMethod · 0.65

Tested by

no test coverage detected