Only run branch detection if in git repo