Problem
gh_detect_default_branch and gh_repo_default_branch use local variable names that can shadow caller-provided output variable names. A caller passing default_branch as the result variable receives an empty value even when detection succeeds.
This was found while consuming the new helpers from Base issue #1488.
Scope
- Rename internal locals in the affected helpers so pass-by-name output works with common names such as
default_branch.
- Add BATS coverage for output variables that match the former internal names.
- Keep the public helper contracts unchanged.
Acceptance Criteria
gh_detect_default_branch <repo_dir> default_branch sets the caller variable.
gh_repo_default_branch <repo> default_branch sets the caller variable.
bats lib/bash/gh/tests/lib_gh.bats passes.
tests/validate.sh passes.
Problem
gh_detect_default_branchandgh_repo_default_branchuse local variable names that can shadow caller-provided output variable names. A caller passingdefault_branchas the result variable receives an empty value even when detection succeeds.This was found while consuming the new helpers from Base issue #1488.
Scope
default_branch.Acceptance Criteria
gh_detect_default_branch <repo_dir> default_branchsets the caller variable.gh_repo_default_branch <repo> default_branchsets the caller variable.bats lib/bash/gh/tests/lib_gh.batspasses.tests/validate.shpasses.