Fix unset variable error when updating with uncommitted changes