Skip to content

Commit

Permalink
Show file when staged to add but deleted in working tree
Browse files Browse the repository at this point in the history
Signed-off-by: Nigel Westbury <nigelipse@miegel.org>
  • Loading branch information
westbury committed Jun 2, 2020
1 parent 815ff18 commit 5d4390c
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/command/status.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { git, gitVersion, IGitExecutionOptions } from '../core/git';
import { parsePorcelainStatus, mapStatus } from '../parser/status-parser';
import { DiffSelectionType, DiffSelection } from '../model/diff';
import { IStatusResult, IAheadBehind, WorkingDirectoryStatus, WorkingDirectoryFileChange, AppFileStatus, FileEntry, GitStatusEntry } from '../model/status';
import { IStatusResult, IAheadBehind, WorkingDirectoryStatus, WorkingDirectoryFileChange, AppFileStatus, FileEntry } from '../model/status';

function convertToAppStatus(status: FileEntry): AppFileStatus {
if (status.kind === 'ordinary') {
Expand Down Expand Up @@ -105,18 +105,6 @@ export async function getStatus(
if (entry.kind === 'entry') {
const status = mapStatus(entry.statusCode);

if (status.kind === 'ordinary') {
// when a file is added in the index but then removed in the working
// directory, the file won't be part of the commit, so we can skip
// displaying this entry in the changes list
if (
status.index === GitStatusEntry.Added &&
status.workingTree === GitStatusEntry.Deleted
) {
continue;
}
}

if (status.kind === 'untracked') {
// when a delete has been staged, but an untracked file exists with the
// same path, we should ensure that we only draw one entry in the
Expand Down

0 comments on commit 5d4390c

Please sign in to comment.