State cleanup
This commit is contained in:
parent
c78b4d665e
commit
db5fa66b48
|
@ -70,4 +70,14 @@ func TestCherrypick(t *testing.T) {
|
||||||
if state != RepositoryStateCherrypick {
|
if state != RepositoryStateCherrypick {
|
||||||
t.Fatal("Incorrect repository state: ", state)
|
t.Fatal("Incorrect repository state: ", state)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
err = repo.StateCleanup()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
state = repo.State()
|
||||||
|
if state != RepositoryStateNone {
|
||||||
|
t.Fatal("Incorrect repository state: ", state)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -652,3 +652,14 @@ func (r *Repository) State() RepositoryState {
|
||||||
|
|
||||||
return RepositoryState(C.git_repository_state(r.ptr))
|
return RepositoryState(C.git_repository_state(r.ptr))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *Repository) StateCleanup() error {
|
||||||
|
runtime.LockOSThread()
|
||||||
|
defer runtime.UnlockOSThread()
|
||||||
|
|
||||||
|
cErr := C.git_repository_state_cleanup(r.ptr)
|
||||||
|
if cErr < 0 {
|
||||||
|
return MakeGitError(cErr)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue