Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

Commit

Permalink
feat: add Refs URL for commit backports
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Oct 18, 2017
1 parent fb4d578 commit 09922ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/backport.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ exports.commitBackport = function commitBackport() {
task: (ctx) => {
const messageTitle = `deps: cherry-pick ${ctx.sha.substring(0, 7)} from upstream V8`;
const messageBody = `Original commit message:\n\n ` +
ctx.message.replace(/\n/g, '\n ');
ctx.message.replace(/\n/g, '\n ') +
`\n\nRefs: https://github.com/v8/v8/commit/${ctx.sha}`;

return execGitNode('add', 'deps/v8')
.then(() => execGitNode('commit', '-m', messageTitle, '-m', messageBody));
Expand All @@ -48,8 +49,8 @@ function generatePatch() {
title: 'Generate patch',
task: (ctx) => {
const sha = ctx.sha;
if (!sha) {
throw new Error('Commit SHA is required');
if (!sha || sha.length !== 40) {
throw new Error('--sha option is required and must be 40 characters long');
}
return Promise.all([
execGitV8('format-patch', '--stdout', `${sha}^..${sha}`),
Expand Down

0 comments on commit 09922ac

Please sign in to comment.