I don't follow this change? Seems that it's fixing the symptom instead of the root cause. You shouldn't call SetHead to the current head. Silently noop-ing isn't the correct behavior, the correct fix would be not to do the wrong call in the first place.