pub fn detect_base_branch( repo: &Path, explicit_base: Option<&str>, ) -> Result<String>
Detect the base branch for PR-style diffs.
Priority: explicit flag > upstream tracking branch > main > master.