Context
check_script_up_to_date can detect both of these states:
- repository is behind upstream, returned as status 2
- tracked script has local modifications, returned as status 3
The current implementation returns 2 as soon as it detects the repo is behind, so status 3 is unreachable when both conditions are true.
Failure Scenario
A repo is behind origin/main and the checked script has local modifications. The helper logs the dirty warning earlier, then returns 2 for behind. Automation that branches on status 3 cannot detect the local modification state.
Scope
- Define the public return-code precedence for combined behind and dirty states.
- Implement the chosen behavior without losing useful log output for either condition.
- Document return statuses in
lib/bash/git/README.md.
- Add BATS coverage for the combined behind plus dirty case.
Acceptance Criteria
- The combined state has a documented and tested return status.
- Existing up-to-date, behind-only, and dirty-only tests continue to pass or are updated to match the documented contract.
./tests/validate.sh passes.
Validation
Context
check_script_up_to_datecan detect both of these states:The current implementation returns 2 as soon as it detects the repo is behind, so status 3 is unreachable when both conditions are true.
Failure Scenario
A repo is behind
origin/mainand the checked script has local modifications. The helper logs the dirty warning earlier, then returns 2 for behind. Automation that branches on status 3 cannot detect the local modification state.Scope
lib/bash/git/README.md.Acceptance Criteria
./tests/validate.shpasses.Validation
./tests/validate.sh