fix(dev-infra): prevent verbose messaging of git checkout and commit for release (#42871)

Prevent logging verbose messages to the output for commit and checkout during
the release process.

PR Close #42871
This commit is contained in:
Joey Perrott 2021-07-15 16:35:57 -07:00 committed by Alex Rickabaugh
parent fd92a3e87f
commit 96d31d8c9f
3 changed files with 12 additions and 12 deletions

View File

@ -6547,14 +6547,14 @@ class ReleaseAction {
*/
createLocalBranchFromHead(branchName) {
return tslib.__awaiter(this, void 0, void 0, function* () {
this.git.run(['checkout', '-B', branchName]);
this.git.run(['checkout', '-q', '-B', branchName]);
});
}
/** Pushes the current Git `HEAD` to the given remote branch in the configured project. */
pushHeadToRemoteBranch(branchName) {
return tslib.__awaiter(this, void 0, void 0, function* () {
// Push the local `HEAD` to the remote branch in the configured project.
this.git.run(['push', this.git.getRepoGitUrl(), `HEAD:refs/heads/${branchName}`]);
this.git.run(['push', '-q', this.git.getRepoGitUrl(), `HEAD:refs/heads/${branchName}`]);
});
}
/**
@ -6581,7 +6581,7 @@ class ReleaseAction {
pushArgs.push('--set-upstream');
}
// Push the local `HEAD` to the remote branch in the fork.
this.git.run(['push', repoGitUrl, `HEAD:refs/heads/${branchName}`, ...pushArgs]);
this.git.run(['push', '-q', repoGitUrl, `HEAD:refs/heads/${branchName}`, ...pushArgs]);
return { fork, branchName };
});
}
@ -6656,7 +6656,7 @@ class ReleaseAction {
checkoutUpstreamBranch(branchName) {
return tslib.__awaiter(this, void 0, void 0, function* () {
this.git.run(['fetch', '-q', this.git.getRepoGitUrl(), branchName]);
this.git.run(['checkout', 'FETCH_HEAD', '--detach']);
this.git.run(['checkout', '-q', 'FETCH_HEAD', '--detach']);
});
}
/**
@ -6666,7 +6666,7 @@ class ReleaseAction {
*/
createCommit(message, files) {
return tslib.__awaiter(this, void 0, void 0, function* () {
this.git.run(['commit', '--no-verify', '-m', message, ...files]);
this.git.run(['commit', '-q', '--no-verify', '-m', message, ...files]);
});
}
/**

View File

@ -211,13 +211,13 @@ export abstract class ReleaseAction {
* existing branches in case of a collision.
*/
protected async createLocalBranchFromHead(branchName: string) {
this.git.run(['checkout', '-B', branchName]);
this.git.run(['checkout', '-q', '-B', branchName]);
}
/** Pushes the current Git `HEAD` to the given remote branch in the configured project. */
protected async pushHeadToRemoteBranch(branchName: string) {
// Push the local `HEAD` to the remote branch in the configured project.
this.git.run(['push', this.git.getRepoGitUrl(), `HEAD:refs/heads/${branchName}`]);
this.git.run(['push', '-q', this.git.getRepoGitUrl(), `HEAD:refs/heads/${branchName}`]);
}
/**
@ -245,7 +245,7 @@ export abstract class ReleaseAction {
pushArgs.push('--set-upstream');
}
// Push the local `HEAD` to the remote branch in the fork.
this.git.run(['push', repoGitUrl, `HEAD:refs/heads/${branchName}`, ...pushArgs]);
this.git.run(['push', '-q', repoGitUrl, `HEAD:refs/heads/${branchName}`, ...pushArgs]);
return {fork, branchName};
}
@ -330,7 +330,7 @@ export abstract class ReleaseAction {
/** Checks out an upstream branch with a detached head. */
protected async checkoutUpstreamBranch(branchName: string) {
this.git.run(['fetch', '-q', this.git.getRepoGitUrl(), branchName]);
this.git.run(['checkout', 'FETCH_HEAD', '--detach']);
this.git.run(['checkout', '-q', 'FETCH_HEAD', '--detach']);
}
/**
@ -339,7 +339,7 @@ export abstract class ReleaseAction {
* @param files List of project-relative file paths to be commited.
*/
protected async createCommit(message: string, files: string[]) {
this.git.run(['commit', '--no-verify', '-m', message, ...files]);
this.git.run(['commit', '-q', '--no-verify', '-m', message, ...files]);
}

View File

@ -107,7 +107,7 @@ export class VirtualGitClient extends AuthenticatedGitClient {
/** Handler for the `git push` command. */
private _push(args: string[]) {
const [repoUrl, refspec] = parseArgs(args)._;
const [repoUrl, refspec] = parseArgs(args, {boolean: ['q']})._;
const ref = this._unwrapRefspec(refspec);
const name = ref.destination || ref.source;
const existingPush =
@ -161,7 +161,7 @@ export class VirtualGitClient extends AuthenticatedGitClient {
/** Handler for the `git checkout` command. */
private _checkout(rawArgs: string[]) {
const args = parseArgs(rawArgs, {boolean: ['detach', 'B']});
const args = parseArgs(rawArgs, {boolean: ['detach', 'B', 'q']});
const createBranch = args['B'];
const detached = args['detach'];
const [target] = args._;