Made git branch detection safe for paths with spaces.