Fix detached head1

Merged thcl requested to merge fix_detached_head into master

Merge request reports