Skip to content

Instantly share code, notes, and snippets.

@hitman401
Created March 4, 2015 04:08
Show Gist options
  • Save hitman401/bce91c4e560728c5d833 to your computer and use it in GitHub Desktop.
Save hitman401/bce91c4e560728c5d833 to your computer and use it in GitHub Desktop.
maidsafe.github.io pull from PR to be changed later. This one doesn't work as of now but must check why this fails while switching between PR
instance.pullForPR = function(selectedPR) {
if (!openPR.hasOwnProperty(selectedPR)) {
return 'echo pull failed - PR not found for selection && exit 1';
}var command;
var actualLocalBranchName;
actualLocalBranchName = selectedPR.replace(/ /g, '_');
command = (branches.indexOf(actualLocalBranchName) > -1) ? 'git branch -D ' + actualLocalBranchName + ' && ': '';
command += instance.CLI.checkout(openPR[selectedPR].base.ref) + '&&' + instance.CLI.pull() + '&&' +
instance.CLI.checkout(selectedPR, true) + '&&' +
instance.CLI.pullRemote(openPR[selectedPR].head.repo.clone_url, openPR[selectedPR].head.ref);
return command;
}
@hitman401
Copy link
Author

Must add listBranches task in grunt:pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment