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:850–869  ·  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

848
849/// Get symbol and path for a graph_op (for display).
850fn hunk_symbol_and_path<H>(graph_op: &GraphOp<H>) -> (&'static str, String) {
851 match graph_op {
852 GraphOp::FileAdd { path, .. } => ("+", path.clone()),
853 GraphOp::FileDel { path, .. } => ("-", path.clone()),
854 GraphOp::FileMove { path, .. } => ("→", path.clone()),
855 GraphOp::FileUndel { path, .. } => ("↑", path.clone()),
856 GraphOp::DirAdd { path, .. } => ("📁+", path.clone()),
857 GraphOp::DirDel { path, .. } => ("📁-", path.clone()),
858 GraphOp::DirUndel { path, .. } => ("📁↑", path.clone()),
859 GraphOp::Edit { local, .. } => ("~", local.path.clone()),
860 GraphOp::Replacement { local, .. } => ("±", local.path.clone()),
861 GraphOp::SolveNameConflict { path, .. } => ("✓", path.clone()),
862 GraphOp::UnsolveNameConflict { path, .. } => ("!", path.clone()),
863 GraphOp::SolveOrderConflict { local, .. } => ("✓", local.path.clone()),
864 GraphOp::UnsolveOrderConflict { local, .. } => ("!", local.path.clone()),
865 GraphOp::ResurrectZombies { local, .. } => ("↑", local.path.clone()),
866 GraphOp::AddRoot { .. } => ("◉", "(root)".to_string()),
867 GraphOp::DelRoot { .. } => ("⊘", "(root)".to_string()),
868 }
869}
870
871#[derive(Debug, Clone, PartialEq, Eq)]
872pub(crate) struct HunkDisplaySummary {

Callers 1

hunk_display_summariesFunction · 0.85

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected