Line

You are reading the unreleased docs (next). See latest (v0.9)

ui/client/features/git-session/hooks/useGitSession

Cockpit client (features), next. Source: ui/client/features/git-session/hooks/useGitSession.tsx.

Functions#

useGitSession()#

useGitSession(): object

Defined in: ui/client/features/git-session/hooks/useGitSession.tsx:29

The commit-on-save session: current config, the branch, what is pending, and the one question this feature may ask (a dirty tree at session start). Polls rather than being told, because commits also happen on a timer, with no request in flight to attach a response to.

Returns#

object

answer

answer: (choice, remember) => Promise<void>

Parameters
choice

DirtyAnswer

remember

boolean

Returns

Promise<void>

busy

busy: boolean = state.busy

commit

commit: () => Promise<void>

Returns

Promise<void>

error

error: string | null = state.error

refresh

refresh: () => Promise<void>

Returns

Promise<void>

status

status: GitSessionStatus | null = state.status

updateConfig

updateConfig: (patch) => Promise<void>

Parameters
patch

Partial<CommitConfig>

Returns

Promise<void>