def _update_files(self, update_index=False): display_untracked = prefs.display_untracked() state = gitcmds.worktree_state_dict(head=self.head, update_index=update_index, display_untracked=display_untracked) self.staged = state.get('staged', []) self.modified = state.get('modified', []) self.unmerged = state.get('unmerged', []) self.untracked = state.get('untracked', []) self.submodules = state.get('submodules', set()) self.upstream_changed = state.get('upstream_changed', []) sel = selection_model() if self.is_empty(): sel.reset() else: sel.update(self) if selection_model().is_empty(): self.set_diff_text('')