Executes the given git command. Throws if the command fails.
(args: string[], options?: GitCommandRunOptions)
| 67 | |
| 68 | /** Executes the given git command. Throws if the command fails. */ |
| 69 | run(args: string[], options?: GitCommandRunOptions): Omit<SpawnSyncReturns<string>, 'status'> { |
| 70 | const result = this.runGraceful(args, options); |
| 71 | if (result.status !== 0) { |
| 72 | throw new GitCommandError(this, args); |
| 73 | } |
| 74 | // Omit `status` from the type so that it's obvious that the status is never |
| 75 | // non-zero as explained in the method description. |
| 76 | return result as Omit<SpawnSyncReturns<string>, 'status'>; |
| 77 | } |
| 78 | |
| 79 | /** |
| 80 | * Spawns a given Git command process. Does not throw if the command fails. Additionally, |
no test coverage detected