commitToVCS commits file changes to version control system
(message string)
| 158 | |
| 159 | // commitToVCS commits file changes to version control system |
| 160 | func (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 |
| 178 | func (fn *Node) revertVCSSelected() { //types:add |
nothing calls this directly
no test coverage detected