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

Function write_repo_state

atomic-cli/src/commands/op/output.rs:358–387  ·  view source on GitHub ↗
(output: &mut String, indent: usize, state: &RepoStateDto)

Source from the content-addressed store, hash-verified

356}
357
358fn write_repo_state(output: &mut String, indent: usize, state: &RepoStateDto) {
359 match &state.view {
360 Some(view) => {
361 writeln!(output, "{}view:", spaces(indent)).unwrap();
362 write_key_value(output, indent + 2, "name", &view.name);
363 write_key_value(output, indent + 2, "state", &view.state);
364 write_key_value(
365 output,
366 indent + 2,
367 "set_id",
368 view.set_id.as_deref().unwrap_or("none"),
369 );
370 }
371 None => write_key_value(output, indent, "view", "none"),
372 }
373 match &state.working_copy {
374 Some(working_copy) => {
375 writeln!(output, "{}working_copy:", spaces(indent)).unwrap();
376 write_working_copy_state(output, indent + 2, working_copy);
377 }
378 None => write_key_value(output, indent, "working_copy", "none"),
379 }
380 match &state.git {
381 Some(git) => {
382 writeln!(output, "{}git:", spaces(indent)).unwrap();
383 write_git_state(output, indent + 2, git);
384 }
385 None => write_key_value(output, indent, "git", "none"),
386 }
387}
388
389fn write_working_copy_state(output: &mut String, indent: usize, state: &WorkingCopyStateDto) {
390 write_key_value(output, indent, "id", &state.id);

Callers 1

render_details_humanFunction · 0.85

Calls 4

write_key_valueFunction · 0.85
write_working_copy_stateFunction · 0.85
write_git_stateFunction · 0.85
unwrapMethod · 0.45

Tested by

no test coverage detected