Skip to content

Commit 1fc836a

Browse files
committed
Removing enum that was based on an incorrect assumption.
1 parent 509c47d commit 1fc836a

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎libraries/package-deps-hash/src/getPackageDeps.ts‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
import * as child_process from 'child_process';
55
import { IPackageDeps } from './IPackageDeps';
66

7-
export type GitStatusChangeType = 'D' | 'M' | 'A';
8-
97
/**
108
* Parses the output of the "git ls-tree" command
119
*/
@@ -43,8 +41,8 @@ export function parseGitLsTree(output: string): Map<string, string> {
4341
/**
4442
* Parses the output of the "git status" command
4543
*/
46-
export function parseGitStatus(output: string, packagePath: string): Map<string, GitStatusChangeType> {
47-
const changes: Map<string, GitStatusChangeType> = new Map<string, GitStatusChangeType>();
44+
export function parseGitStatus(output: string, packagePath: string): Map<string, string> {
45+
const changes: Map<string, string> = new Map<string, string>();
4846

4947
/*
5048
* Typically, output will look something like:
@@ -80,7 +78,7 @@ export function parseGitStatus(output: string, packagePath: string): Map<string,
8078
// We always care about the last filename in the filenames array. In the case of non-rename changes,
8179
// the filenames array only contains one item. In the case of rename changes, the last item in the
8280
// array is the path to the file in the working tree, which is the only one that we care about.
83-
changes.set(filenames[filenames.length - 1], changeType as GitStatusChangeType);
81+
changes.set(filenames[filenames.length - 1], changeType);
8482
}
8583
});
8684

@@ -155,11 +153,11 @@ export function getPackageDeps(packagePath: string = process.cwd(), excludedPath
155153

156154
// Update the checked in hashes with the current repo status
157155
const gitStatusOutput: string = gitStatus(packagePath);
158-
const currentlyChangedFiles: Map<string, GitStatusChangeType > =
156+
const currentlyChangedFiles: Map<string, string> =
159157
parseGitStatus(gitStatusOutput, packagePath);
160158

161159
const filesToHash: string[] = [];
162-
currentlyChangedFiles.forEach((changeType: GitStatusChangeType, filename: string) => {
160+
currentlyChangedFiles.forEach((changeType: string, filename: string) => {
163161
if (changeType === 'D') {
164162
delete changes.files[filename];
165163
} else {

0 commit comments

Comments
 (0)