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

Function hunk_symbol_and_path

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

Get symbol and path for a graph_op (for display).

(graph_op: &GraphOp<H>)

Source from the content-addressed store, hash-verified

871
872/// Get symbol and path for a graph_op (for display).
873fn hunk_symbol_and_path<H>(graph_op: &GraphOp<H>) -> (&'static str, String) {
874 match graph_op {
875 GraphOp::FileAdd { path, .. } => ("+", path.clone()),
876 GraphOp::FileDel { path, .. } => ("-", path.clone()),
877 GraphOp::FileMove { path, .. } => ("→", path.clone()),
878 GraphOp::FileUndel { path, .. } => ("↑", path.clone()),
879 GraphOp::DirAdd { path, .. } => ("📁+", path.clone()),
880 GraphOp::DirDel { path, .. } => ("📁-", path.clone()),
881 GraphOp::DirUndel { path, .. } => ("📁↑", path.clone()),
882 GraphOp::Edit { local, .. } => ("~", local.path.clone()),
883 GraphOp::Replacement { local, .. } => ("±", local.path.clone()),
884 GraphOp::SolveNameConflict { path, .. } => ("✓", path.clone()),
885 GraphOp::UnsolveNameConflict { path, .. } => ("!", path.clone()),
886 GraphOp::SolveOrderConflict { local, .. } => ("✓", local.path.clone()),
887 GraphOp::UnsolveOrderConflict { local, .. } => ("!", local.path.clone()),
888 GraphOp::ResurrectZombies { local, .. } => ("↑", local.path.clone()),
889 GraphOp::AddRoot { .. } => ("◉", "(root)".to_string()),
890 GraphOp::DelRoot { .. } => ("⊘", "(root)".to_string()),
891 }
892}
893
894#[derive(Debug, Clone, PartialEq, Eq)]
895pub(crate) struct HunkDisplaySummary {

Callers 1

hunk_display_summariesFunction · 0.85

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected