pub fn set_head_commit(shard_dir: &Path, commit_id: &str) -> Result<()>
Set HEAD to a bare commit id (detached).