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

Function baseline_tree

atomic-cli/src/commands/git/shadow.rs:2085–2090  ·  view source on GitHub ↗

The tree the projection builds on: the tip of `baseline_ref` when it resolves, else HEAD's. `None` (unborn, or neither resolves) leaves every marker counted.

(git: &'g GitRepository, baseline_ref: Option<&str>)

Source from the content-addressed store, hash-verified

2083/// resolves, else HEAD's. `None` (unborn, or neither resolves) leaves every
2084/// marker counted.
2085fn baseline_tree<'g>(git: &'g GitRepository, baseline_ref: Option<&str>) -> Option<git2::Tree<'g>> {
2086 let from_ref = baseline_ref
2087 .and_then(|name| git.find_reference(name).ok())
2088 .and_then(|reference| reference.peel_to_tree().ok());
2089 from_ref.or_else(|| git.head().ok()?.peel_to_tree().ok())
2090}
2091
2092/// Whether `tree` holds exactly `bytes`: at `path`, or — after a rename of
2093/// the marker-bearing file — as the same blob anywhere in the tree. A tree

Callers 1

refuse_conflict_markersFunction · 0.85

Calls 2

okMethod · 0.45
headMethod · 0.45

Tested by

no test coverage detected