MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / require_worktree

Function require_worktree

atomic-repository/src/wip.rs:327–341  ·  view source on GitHub ↗
(root: &Path)

Source from the content-addressed store, hash-verified

325}
326
327fn require_worktree(root: &Path) -> Result<(), WipCaptureError> {
328 let inside = git_text(
329 root,
330 "identify Git working tree",
331 &os_args(&["rev-parse", "--is-inside-work-tree"]),
332 None,
333 None,
334 )?;
335 if inside != "true" {
336 return Err(WipCaptureError::NotAWorkingTree {
337 path: root.to_path_buf(),
338 });
339 }
340 Ok(())
341}
342
343fn resolve_head(root: &Path) -> Result<Option<String>, WipCaptureError> {
344 let output = run_git_raw(

Callers 1

prepare_tracked_wipFunction · 0.85

Calls 2

os_argsFunction · 0.85
git_textFunction · 0.70

Tested by

no test coverage detected