Skip to content

Commit

Permalink
git-node: auto amend metadata and open manual amend on request
Browse files Browse the repository at this point in the history
This makes sure manual amend is started in case the user requested
that without the need to edit any intermediate files.

Refs: nodejs#425
  • Loading branch information
BridgeAR committed May 30, 2020
1 parent 75abd3a commit e8646d0
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/landing_session.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,11 @@ class LandingSession extends Session {
cli.separator('New Message');
cli.log(message.trim());
const takeMessage = await cli.prompt('Use this message?');
await runAsync('git', ['commit', '--amend', '-F', messageFile]);
if (takeMessage) {
await runAsync('git', ['commit', '--amend', '-F', messageFile]);
return true;
}

// TODO: fire the configured git editor on that file
cli.log(`Please manually edit ${messageFile}, then run\n` +
`\`git commit --amend -F ${messageFile}\` ` +
'to finish amending the message');
process.exit(1); // make it work with git rebase -x
await runAsync('git', ['commit', '--amend']);
}

async final() {
Expand Down

0 comments on commit e8646d0

Please sign in to comment.