Add current branch recognition in check up-to-date function