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

Function current_git_branch

atomic-cli/src/commands/git/import.rs:179–185  ·  view source on GitHub ↗
(git_repo: &GitRepository)

Source from the content-addressed store, hash-verified

177}
178
179fn current_git_branch(git_repo: &GitRepository) -> Option<String> {
180 let head = git_repo.head().ok()?;
181 if !head.is_branch() {
182 return None;
183 }
184 head.shorthand().ok().map(ToOwned::to_owned)
185}
186
187/// Binding transport requires the ordinary importer. Presence selects the
188/// route only; it is not evidence that any binding is valid or trusted.

Callers 2

get_default_branchMethod · 0.85
run_importMethod · 0.85

Calls 2

okMethod · 0.45
headMethod · 0.45

Tested by

no test coverage detected