Gets the currently checked out branch or revision.
()
| 154 | // Encoding is always `utf8` and not overridable. This ensures that this method |
| 155 | // always returns `string` as output instead of buffers. |
| 156 | encoding: 'utf8', |
| 157 | }); |
| 158 | |
| 159 | Log.debug(`Status: ${result.status}, Error: ${!!result.error}, Signal: ${result.signal}`); |
| 160 | |
| 161 | if (result.status !== 0 && result.stderr !== null && result.stderr !== undefined) { |
| 162 | // Git sometimes prints the command if it failed. This means that it could |
| 163 | // potentially leak the Github token used for accessing the remote. To avoid |
| 164 | // printing a token, we sanitize the string before printing the stderr output. |
| 165 | process.stderr.write(this.sanitizeConsoleOutput(result.stderr)); |
| 166 | } |
| 167 | |
| 168 | Log.debug('Stdout:', result.stdout ? this.sanitizeConsoleOutput(result.stdout) : result.stdout); |
no test coverage detected