Skip to content

Fix gh helper output-variable shadowing #121

Description

@codeforester

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is not working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions