register_ref(): make a copy of the bad reference SHA-1