Skip to content

Commit

Permalink
Do not attempt to show a diff for untracked files
Browse files Browse the repository at this point in the history
  • Loading branch information
krassowski committed Feb 25, 2021
1 parent f5df357 commit 3e08ea2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/commandsAndMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,11 @@ export function addCommands(
for (const file of files) {
const { context, filePath, isText, status } = file;

// nothing to compare to for untracked files
if (status === 'untracked') {
continue;
}

let diffContext = context;
if (!diffContext) {
const specialRef = status === 'staged' ? 'INDEX' : 'WORKING';
Expand Down

0 comments on commit 3e08ea2

Please sign in to comment.