pub fn verify_branch(branch: &str, dir: &Path) -> boolExpand description
Verify that a branch exists locally in the given repository.
Internally runs:
git rev-parse --verify <branch>This is a thin wrapper around get_git_output, returning true if the
Git call succeeds and false otherwise.
§Arguments
branch— The name of the branch to check.dir— Path to the Git repository root or working directory.
§Returns
trueif the branch exists locally.falseotherwise.
§Example
use std::path::Path;
use mdbook_gitinfo::git::verify_branch;
let dir = Path::new(".");
if !verify_branch("dev", dir) {
eprintln!("Branch 'dev' not found, falling back to 'main'");
}