if source repo in detached branch, should checkout it back to master first