You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: git.rs
    path of file: ./repos/rerun/crates/re_build_tools/src
    
    the code of the file until where you have to start completion: //! # Situations to consider regarding git
//!
//! ## Using the published crate
//!
//! The published crate carries its version around, which in turns gives us the git tag, which makes
//! the commit hash irrelevant.
//! We still need to compute _something_ so that we can actually build, but that value will be
//! ignored when the crate is built by the end user anyhow.
//!
//! ## Working directly within the workspace
//!
//! When working within the workspace, we can simply try and call `git`
    
fn parse_branch_from_github_ref() -> Option<String> {
    // The ref given is fully-formed, meaning that for branches the format is refs/heads/<branch_name>,
    // for pull requests it is refs/pull/<pr_number>/merge, and for tags it is refs/tags/<tag_name>.
    // For example, refs/heads/feature-branch-1.
    // https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables

    let github_ref = std::env::var("GITHUB_REF").ok()?;
    let branch = github_ref
        .strip_prefix("refs/")?
        .split_once('/')?
        .1
        .to_owned();
    Some(branch)
}