git: extract export_head_to_git()
to lib function, refactor caller
#6666
This run and associated checks have been archived and are scheduled for deletion.
Learn more about checks retention