Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions lib/views/staging-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,12 @@ export default class StagingView {
// due to changes being fully staged/unstaged/stashed/deleted/etc
return this.props.workspace.getPanes().filter(pane => {
const pendingItem = pane.getPendingItem();
if (!pendingItem) { return false; }
const isDiffViewItem = pendingItem.getRealItem && pendingItem.getRealItem() instanceof FilePatchController;
if (!pendingItem || !pendingItem.getRealItem) { return false; }
const realItem = pendingItem.getRealItem();
const isDiffViewItem = realItem instanceof FilePatchController;
// We only want to update pending diff views for currently active repo
const isInActiveRepo = pendingItem.getWorkingDirectory() === this.props.workingDirectoryPath;
const isStale = !this.changedFileExists(pendingItem.getFilePath(), pendingItem.getStagingStatus());
const isInActiveRepo = realItem.getWorkingDirectory() === this.props.workingDirectoryPath;
const isStale = !this.changedFileExists(realItem.getFilePath(), realItem.getStagingStatus());
return isDiffViewItem && isInActiveRepo && isStale;
});
}
Expand Down