Repository navigation
Closed
Description
Currently, our status models parse Added files and Untracked files as AppFileStatusKind.New. Unfortunately, this means we lose information in the application about which files are which.
desktop/app/src/lib/git/status.ts
Lines 104 to 130 in b556ff8
| function convertToAppStatus( | |
| path: string, | |
| entry: FileEntry, | |
| filesWithConflictMarkers: ConflictCountsByPath, | |
| oldPath?: string | |
| ): AppFileStatus { | |
| if (entry.kind === 'ordinary') { | |
| switch (entry.type) { | |
| case 'added': | |
| return { kind: AppFileStatusKind.New } | |
| case 'modified': | |
| return { kind: AppFileStatusKind.Modified } | |
| case 'deleted': | |
| return { kind: AppFileStatusKind.Deleted } | |
| } | |
| } else if (entry.kind === 'copied' && oldPath != null) { | |
| return { kind: AppFileStatusKind.Copied, oldPath } | |
| } else if (entry.kind === 'renamed' && oldPath != null) { | |
| return { kind: AppFileStatusKind.Renamed, oldPath } | |
| } else if (entry.kind === 'untracked') { | |
| return { kind: AppFileStatusKind.New } | |
| } else if (entry.kind === 'conflicted') { | |
| return parseConflictedState(entry, path, filesWithConflictMarkers) | |
| } | |
| return fatalError(`Unknown file status ${status}`) | |
| } |
This issue proposes adding an AppFileStatusKind.Untracked to cover this case.
required to fix #6411
Activity
shiftkey commentedon Dec 21, 2018
One thing to keep an eye out for is the cascading effects from this, like in
mapStatusandiconForStatus:desktop/app/src/lib/status.ts
Line 17 in b556ff8
desktop/app/src/ui/octicons/status.ts
Line 11 in b556ff8
I think we should still map
AppFileStatusKind.Untrackedto'New'andOcticonSymbol.diffAddedin these cases, rather than introduce new terminology or expose the "untracked" concept at this stage.