Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/landing_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,9 @@ 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', ...allowEmptyCommits, ...this.gpgSign, `${base}..${head}`],
['cherry-pick', '--allow-empty', ...this.gpgSign, `${base}..${head}`],
{ ignoreFailure: false });
} catch (ex) {
cli.error('Failed to apply patches');
Expand Down Expand Up @@ -152,11 +151,11 @@ export default class LandingSession extends Session {

getRebaseSuggestion(subjects) {
const { upstream, branch } = this;
let command = `git rebase ${upstream}/${branch} -i`;
let command = `git rebase ${upstream}/${branch} --no-keep-empty -i`;
command += ' -x "git node land --amend"';

const squashes = subjects.filter(
line => line.includes('fixup!') || line.includes('squash!'));
line => line.includes('fixup!') || line.includes('squash!') || line.includes('amend!'));

if (squashes.length !== 0) {
command += ' --autosquash';
Expand Down Expand Up @@ -233,7 +232,8 @@ export default class LandingSession extends Session {
const msgAmend = `-x "git node land --amend ${assumeYes}"`;
try {
await forceRunAsync('git',
['rebase', ...this.gpgSign, `${upstream}/${branch}`, '-i', '--autosquash', msgAmend],
['rebase', ...this.gpgSign, `${upstream}/${branch}`,
'--no-keep-empty', '-i', '--autosquash', msgAmend],
{
ignoreFailure: false,
spawnArgs: {
Expand Down