Update also work when commit hash changes.

Should fix part of issue #994 (if not completely depending on what the discussion leads to).