Only set undodir when not in diff mode.