* 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>)
| 257 | * utility within `GitClient`'s methods to create outputs as array. |
| 258 | */ |
| 259 | function 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. */ |
| 267 | export function assertValidGitRef(ref: string) { |
no outgoing calls
no test coverage detected