Enhance target branch autodetect.