diff --git a/build-tools/packages/build-cli/src/library/git.ts b/build-tools/packages/build-cli/src/library/git.ts index 9df6771a464c..c62402684f2f 100644 --- a/build-tools/packages/build-cli/src/library/git.ts +++ b/build-tools/packages/build-cli/src/library/git.ts @@ -165,9 +165,11 @@ export class Repository implements GitContext { public async getShaForBranch(branch: string, remote?: string): Promise { const refspec = remote === undefined ? `refs/heads/${branch}` : `refs/remotes/${remote}/${branch}`; + // result is a string of the form '64adcdba56deb16e0641c91ca825401a9f7a01f9 refs/heads/release/client/2.23' const result = await this.git.raw(`show-ref`, refspec); - return result; + const [sha] = result.split(" "); + return sha; } /** @@ -465,7 +467,7 @@ export class Repository implements GitContext { * Fetch branch */ public async fetchBranch(remote: string, branchName: string): Promise { - await this.gitClient.fetch(remote, [branchName]); + await this.gitClient.fetch(remote, branchName); } } diff --git a/build-tools/packages/build-cli/src/library/releasePrepChecks.ts b/build-tools/packages/build-cli/src/library/releasePrepChecks.ts index 24c297895c21..af48f19b6e3e 100644 --- a/build-tools/packages/build-cli/src/library/releasePrepChecks.ts +++ b/build-tools/packages/build-cli/src/library/releasePrepChecks.ts @@ -135,7 +135,7 @@ export const CheckHasRemoteBranchUpToDate: CheckFunction = async ( return { message: `Error when checking remote branch. Does the remote branch exist? Full error message:\n${ (error as Error).message - }`, + }\n${(error as Error).stack}`, }; }