Skip to main content

agent_doc_commit

Function agent_doc_commit 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn agent_doc_commit( file_path: *const c_char, ) -> bool
Expand description

Commit the document at file_path to git (Fix 4: plugin post-apply commit).

Defense-in-depth guarantee: editor plugins call this after successfully applying a patch so the agent response is committed even when the shell-side --commit was skipped (e.g., IPC timeout path). Uses a minimal inline git flow rather than the full git::commit (which lives in the binary crate) — stages the document file and commits with a timestamp message.

Returns true on success, false on failure (null pointer, invalid UTF-8, git error).

§Safety

file_path must be a valid NUL-terminated UTF-8 string, or null.