MCPcopy Create free account
hub / github.com/angular/dev-infra / gitOutputAsArray

Function gitOutputAsArray

ng-dev/utils/git/git-client.ts:259–264  ·  view source on GitHub ↗

* Takes the output from `run` and `runGraceful` and returns an array of strings for each * new line. Git commands typically return multiple output values for a command a set of * strings separated by new lines. * * Note: This is specifically created as a locally available function for usage as c

(gitCommandResult: SpawnSyncReturns<string>)

Source from the content-addressed store, hash-verified

257 /** Retrieve a list of all files currently staged in the repostitory. */
258 allStagedFiles(): string[] {
259 return gitOutputAsArray(
260 this.runGraceful(['diff', '--name-only', '--diff-filter=ACM', '--staged']),
261 );
262 }
263
264 /** Retrieve a list of all files tracked in the repository. */
265 allFiles(): string[] {
266 return gitOutputAsArray(this.runGraceful(['ls-files']));
267 }

Callers 3

allChangesFilesSinceMethod · 0.85
allStagedFilesMethod · 0.85
allFilesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected