- Modified `scripts/review_pull_requests.py` to filter `git for-each-ref` output by unmerged branches.
- Reduces algorithmic complexity from O(N) to O(M) where N is total branches and M is active branches.
- Avoids expensive `ahead-behind` calculations for potentially thousands of stale merged branches.
- Replaced O(N) `git log` parsing with O(1) `git rev-list --count` for branch commit counts.
- Updated `get_all_branch_details` to return an empty `commits` list to ensure consistent data structure with `get_branch_info`, preventing potential runtime errors.
- Changed base branch reference from `main` to `origin/main` to support CI/CD environments and shallow clones where local `main` might be missing.
- Removed unused `commits` list generation in `get_branch_info` to improve fallback performance.
Replaced per-branch git log calls with a single git for-each-ref command using the ahead-behind atom. This optimizes the script from O(N) to O(1) git subprocess calls.
Co-authored-by: Mouy-leng <199350297+Mouy-leng@users.noreply.github.com>