Skip to content

Fix gh helper output-variable shadowing #122

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.

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething is not working

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions