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 * utility within `GitClient`'s methods to create outputs as array.
258 */
259function gitOutputAsArray(gitCommandResult: SpawnSyncReturns<string>): string[] {
260 return gitCommandResult.stdout
261 .split('\n')
262 .map((x) => x.trim())
263 .filter((x) => !!x);
264}
265
266/** Assert that a Git reference is valid and does not start with a hyphen. */
267export function assertValidGitRef(ref: string) {

Callers 3

allChangesFilesSinceMethod · 0.85
allStagedFilesMethod · 0.85
allFilesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected