[states] fix a bug with rebase --detach There is unexpected (for me) content in state.
Pierre-Yves David