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

Function get_hunk_path

atomic-cli/src/commands/change/command.rs:553–573  ·  view source on GitHub ↗

Get the path from a graph_op.

(graph_op: &GraphOp<H>)

Source from the content-addressed store, hash-verified

551
552/// Get the path from a graph_op.
553fn get_hunk_path<H>(graph_op: &GraphOp<H>) -> Option<String> {
554 match graph_op {
555 GraphOp::FileAdd { path, .. } => Some(path.clone()),
556 GraphOp::FileDel { path, .. } => Some(path.clone()),
557 GraphOp::FileMove { path, .. } => Some(path.clone()),
558 GraphOp::FileUndel { path, .. } => Some(path.clone()),
559 GraphOp::DirAdd { path, .. } => Some(path.clone()),
560 GraphOp::DirDel { path, .. } => Some(path.clone()),
561 GraphOp::DirUndel { path, .. } => Some(path.clone()),
562 GraphOp::Edit { local, .. } => Some(local.path.clone()),
563 GraphOp::Replacement { local, .. } => Some(local.path.clone()),
564 GraphOp::SolveNameConflict { path, .. } => Some(path.clone()),
565 GraphOp::UnsolveNameConflict { path, .. } => Some(path.clone()),
566 GraphOp::SolveOrderConflict { local, .. } => Some(local.path.clone()),
567 GraphOp::UnsolveOrderConflict { local, .. } => Some(local.path.clone()),
568 GraphOp::ResurrectZombies { local, .. } => Some(local.path.clone()),
569 GraphOp::AddRoot { .. } => None,
570 GraphOp::DelRoot { .. } => None,
571 GraphOp::SetAttr { path, .. } => Some(path.clone()),
572 }
573}

Callers 1

count_unique_pathsFunction · 0.85

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected