Merge pull request #74 from fd/master

Added force argument for (*Submodule).Reload() and (*Repository).ReloadAllSubmodules()
This commit is contained in:
Carlos Martín Nieto 2014-03-31 17:08:00 +02:00
commit 5adb756c48
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)
} }