update: Ensure the tree is clean first

Signed-off-by: Robin Green <greenrd@greenrd.org>
Improved error messages for unclean working directory or index

Signed-off-by: Robin Green <greenrd@greenrd.org>