From 6cc8da2452a3383a48bb03c1b8d5cff94e791b64 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 8 Mar 2023 16:58:53 +0100 Subject: [PATCH] feat(land): allow empty commits with fixupAll --- lib/landing_session.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/landing_session.js b/lib/landing_session.js index c4745be1..ef7890fc 100644 --- a/lib/landing_session.js +++ b/lib/landing_session.js @@ -116,10 +116,12 @@ export default class LandingSession extends Session { const commitInfo = { base, head, shas: commitShas }; this.saveCommitInfo(commitInfo); + const allowEmptyCommits = this.fixupAll ? ['--allow-empty'] : []; try { - await forceRunAsync('git', ['cherry-pick', `${base}..${head}`], { - ignoreFailure: false - }); + await forceRunAsync('git', + ['cherry-pick', ...allowEmptyCommits, `${base}..${head}`], + { ignoreFailure: false } + ); } catch (ex) { cli.error('Failed to apply patches'); process.exit(1);