Fix detached HEAD issue
When the repository is in a detached HEAD state, skip outputting the reference change cargo key, rather than erroring the build script.
When the repository is in a detached HEAD state, skip outputting the reference change cargo key, rather than erroring the build script.