Files
llmx/codex-rs/git-tooling
pakrym-oai 5c42419b02 Use assert_matches (#4756)
assert_matches is soon to be in std but is experimental for now.
2025-10-05 21:12:31 +00:00
..
2025-10-05 21:12:31 +00:00
2025-10-05 21:12:31 +00:00
2025-09-23 16:59:52 +01:00

codex-git-tooling

Helpers for interacting with git.

use std::path::Path;

use codex_git_tooling::{create_ghost_commit, restore_ghost_commit, CreateGhostCommitOptions};

let repo = Path::new("/path/to/repo");

// Capture the current working tree as an unreferenced commit.
let ghost = create_ghost_commit(&CreateGhostCommitOptions::new(repo))?;

// Later, undo back to that state.
restore_ghost_commit(repo, &ghost)?;

Pass a custom message with .message("…") or force-include ignored files with .force_include(["ignored.log".into()]).