Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
save
  • Loading branch information
Nikhil Thorat committed Sep 9, 2019
commit 4c69f6236c9c6c5eb0eddaecdc642b58556f7de9
3 changes: 3 additions & 0 deletions scripts/diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,14 @@ const isPullRequestFromFork = res.code !== 0;
// Only checkout the merge base if the pull requests comes from a
// tensorflow/tfjs branch. Otherwise clone master and diff against master.
if (!isPullRequestFromFork) {
console.log('PR is coming from tensorflow/tfjs. Finding the merge base...');
exec(`git checkout ${branchName}`);
const mergeBase = exec(`git merge-base master ${branchName}`).stdout.trim();
exec(`git fetch origin ${mergeBase}`);
exec(`git checkout ${mergeBase}`);
console.log('mergeBase: ', mergeBase);
} else {
console.log('PR is coming from a fork. Diffing against master.');
}

shell.cd('..');
Expand Down