Added force argument for (*Submodule).Reload() and (*Repository).ReloadAllSubmodules()

This commit is contained in:
Simon Menke 2014-03-27 11:32:22 +01:00
parent 2811845a12
commit 429408dbe5
1 changed files with 4 additions and 4 deletions

View File

@ -287,22 +287,22 @@ func (sub *Submodule) Open() (*Repository, error) {
return repo, nil return repo, nil
} }
func (sub *Submodule) Reload() error { func (sub *Submodule) Reload(force bool) error {
runtime.LockOSThread() runtime.LockOSThread()
defer runtime.UnlockOSThread() defer runtime.UnlockOSThread()
ret := C.git_submodule_reload(sub.ptr) ret := C.git_submodule_reload(sub.ptr, cbool(force))
if ret < 0 { if ret < 0 {
return MakeGitError(ret) return MakeGitError(ret)
} }
return nil return nil
} }
func (repo *Repository) ReloadAllSubmodules() error { func (repo *Repository) ReloadAllSubmodules(force bool) error {
runtime.LockOSThread() runtime.LockOSThread()
defer runtime.UnlockOSThread() defer runtime.UnlockOSThread()
ret := C.git_submodule_reload_all(repo.ptr) ret := C.git_submodule_reload_all(repo.ptr, cbool(force))
if ret < 0 { if ret < 0 {
return MakeGitError(ret) return MakeGitError(ret)
} }