@@ -5883,9 +5883,11 @@ class GitCommandManager {
58835883 yield this.execGit(['lfs', 'install', '--local']);
58845884 });
58855885 }
5886- log1() {
5886+ log1(format ) {
58875887 return __awaiter(this, void 0, void 0, function* () {
5888- const output = yield this.execGit(['log', '-1']);
5888+ var args = format ? ['log', '-1', format] : ['log', '-1'];
5889+ var silent = format ? false : true;
5890+ const output = yield this.execGit(args, false, silent);
58895891 return output.stdout;
58905892 });
58915893 }
@@ -6007,7 +6009,7 @@ class GitCommandManager {
60076009 return result;
60086010 });
60096011 }
6010- execGit(args, allowAllExitCodes = false) {
6012+ execGit(args, allowAllExitCodes = false, silent = false ) {
60116013 return __awaiter(this, void 0, void 0, function* () {
60126014 fshelper.directoryExistsSync(this.workingDirectory, true);
60136015 const result = new GitOutput();
@@ -6022,6 +6024,7 @@ class GitCommandManager {
60226024 const options = {
60236025 cwd: this.workingDirectory,
60246026 env,
6027+ silent,
60256028 ignoreReturnCode: allowAllExitCodes,
60266029 listeners: {
60276030 stdout: (data) => {
@@ -6267,8 +6270,10 @@ function getSource(settings) {
62676270 yield authHelper.removeGlobalAuth();
62686271 }
62696272 }
6270- // Dump some info about the checked out commit
6273+ // Get commit information
62716274 const commitInfo = yield git.log1();
6275+ // Log commit sha
6276+ yield git.log1("--format='%H'");
62726277 // Check for incorrect pull request merge commit
62736278 yield refHelper.checkCommitInfo(settings.authToken, commitInfo, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit);
62746279 }
0 commit comments