Skip to main content

recent_branches

Function recent_branches 

Source
pub fn recent_branches(
    cwd: &Path,
    since: SystemTime,
    include_remote_branches: bool,
    only_remote: Option<&str>,
) -> Result<Vec<RecentRef>, Error>
Expand description

Refs whose tip commit was authored on or after since. Mirrors upstream’s git.RecentBranches (git/git.go::RecentBranches).

Output is filtered:

  • if include_remote_branches is false, refs under refs/remotes/ are dropped entirely.
  • if only_remote is Some(name), remote refs not under refs/remotes/<name>/ are dropped (local refs and tags pass through regardless).

git for-each-ref is asked to sort newest-first; the iteration stops at the first ref older than since so large repos don’t pay for refs they’d discard anyway.