Programmatically Detect branch for git comparison