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

Method getCurrentBranchOrRevision

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

Gets the currently checked out branch or revision.

()

Source from the content-addressed store, hash-verified

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);

Callers 9

SnapshotPublisherClass · 0.80
ReleaseToolClass · 0.80
rebasePrFunction · 0.80
mergeMethod · 0.80
checkMethod · 0.80
mergeMethod · 0.80

Calls 1

runMethod · 0.95

Tested by

no test coverage detected