mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
5c42419b02
assert_matches is soon to be in std but is experimental for now.
5c42419b02
·
2025-10-05 21:12:31 +00:00
History
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()]).