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:815–834  ·  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

813
814/// Get symbol and path for a graph_op (for display).
815fn hunk_symbol_and_path<H>(graph_op: &GraphOp<H>) -> (&'static str, String) {
816 match graph_op {
817 GraphOp::FileAdd { path, .. } => ("+", path.clone()),
818 GraphOp::FileDel { path, .. } => ("-", path.clone()),
819 GraphOp::FileMove { path, .. } => ("→", path.clone()),
820 GraphOp::FileUndel { path, .. } => ("↑", path.clone()),
821 GraphOp::DirAdd { path, .. } => ("📁+", path.clone()),
822 GraphOp::DirDel { path, .. } => ("📁-", path.clone()),
823 GraphOp::DirUndel { path, .. } => ("📁↑", path.clone()),
824 GraphOp::Edit { local, .. } => ("~", local.path.clone()),
825 GraphOp::Replacement { local, .. } => ("±", local.path.clone()),
826 GraphOp::SolveNameConflict { path, .. } => ("✓", path.clone()),
827 GraphOp::UnsolveNameConflict { path, .. } => ("!", path.clone()),
828 GraphOp::SolveOrderConflict { local, .. } => ("✓", local.path.clone()),
829 GraphOp::UnsolveOrderConflict { local, .. } => ("!", local.path.clone()),
830 GraphOp::ResurrectZombies { local, .. } => ("↑", local.path.clone()),
831 GraphOp::AddRoot { .. } => ("◉", "(root)".to_string()),
832 GraphOp::DelRoot { .. } => ("⊘", "(root)".to_string()),
833 }
834}
835
836#[derive(Debug, Clone, PartialEq, Eq)]
837pub(crate) struct HunkDisplaySummary {

Callers 1

hunk_display_summariesFunction · 0.85

Calls 1

cloneMethod · 0.45

Tested by

no test coverage detected