@@ -39,6 +39,7 @@ exports.createOrUpdateBranch = exports.tryFetch = exports.getWorkingBaseAndType
3939const core = __importStar(__nccwpck_require__(2186));
4040const uuid_1 = __nccwpck_require__(5840);
4141const CHERRYPICK_EMPTY = 'The previous cherry-pick is now empty, possibly due to conflict resolution.';
42+ const NOTHING_TO_COMMIT = 'nothing to commit, working tree clean';
4243var WorkingBaseType;
4344(function (WorkingBaseType) {
4445 WorkingBaseType["Branch"] = "branch";
@@ -138,7 +139,11 @@ function createOrUpdateBranch(git, commitMessage, base, branch, branchRemoteName
138139 if (signoff) {
139140 popts.push('--signoff');
140141 }
141- yield git.commit(popts);
142+ const commitResult = yield git.commit(popts, true);
143+ // 'nothing to commit' can occur when core.autocrlf is set to true
144+ if (commitResult.exitCode != 0 && !commitResult.stdout.includes(NOTHING_TO_COMMIT)) {
145+ throw new Error(`Unexpected error: ${commitResult.stderr}`);
146+ }
142147 }
143148 // Remove uncommitted tracked and untracked changes
144149 yield git.exec(['reset', '--hard']);
@@ -674,7 +679,7 @@ class GitCommandManager {
674679 return yield this.exec(args, allowAllExitCodes);
675680 });
676681 }
677- commit(options) {
682+ commit(options, allowAllExitCodes = false ) {
678683 return __awaiter(this, void 0, void 0, function* () {
679684 const args = ['commit'];
680685 if (this.identityGitOptions) {
@@ -683,7 +688,7 @@ class GitCommandManager {
683688 if (options) {
684689 args.push(...options);
685690 }
686- yield this.exec(args);
691+ return yield this.exec(args, allowAllExitCodes );
687692 });
688693 }
689694 config(configKey, configValue, globalConfig) {
0 commit comments