(url, path string, use_git_link bool)
| 159 | } |
| 160 | |
| 161 | func (c *SubmoduleCollection) Add(url, path string, use_git_link bool) (*Submodule, error) { |
| 162 | curl := C.CString(url) |
| 163 | defer C.free(unsafe.Pointer(curl)) |
| 164 | cpath := C.CString(path) |
| 165 | defer C.free(unsafe.Pointer(cpath)) |
| 166 | |
| 167 | runtime.LockOSThread() |
| 168 | defer runtime.UnlockOSThread() |
| 169 | |
| 170 | var ptr *C.git_submodule |
| 171 | ret := C.git_submodule_add_setup(&ptr, c.repo.ptr, curl, cpath, cbool(use_git_link)) |
| 172 | if ret < 0 { |
| 173 | return nil, MakeGitError(ret) |
| 174 | } |
| 175 | return newSubmoduleFromC(ptr, c.repo), nil |
| 176 | } |
| 177 | |
| 178 | func (sub *Submodule) FinalizeAdd() error { |
| 179 | runtime.LockOSThread() |
nothing calls this directly
no test coverage detected