check_branch_commit(): make first parameter const