message: Warn when origin prefix is stripped
diff: @@ -6,6 +6,7 @@ import missingTravisInfo from '../ui/messages/errors/missingTravisInfo';
  import travisInternalBuild from '../ui/messages/warnings/travisInternalBuild';
  import { getBranch, getCommit, hasPreviousCommit } from './git';
  +const ORIGIN_PREFIX_REGEXP = /^origin\//;
  const notHead = (branch) => (branch && branch !== 'HEAD' ? branch : false);
  export async function getCommitAndBranch({ branchName, patchBaseRef, ci, log } = {}) {
  @@ -86,7 +87,10 @@ export async function getCommitAndBranch({ branchName, patchBaseRef, ci, log } =
  !!process.env.GITHUB_REPOSITORY;
  // Strip off any `origin/` prefix that's added sometimes.
  - if (!branchName && !isFromEnvVariable) branch = branch.replace(/^origin\//, '');
  + if (!branchName && !isFromEnvVariable && ORIGIN_PREFIX_REGEXP.test(branch)) {
  + log.warn(`Ignoring 'origin/' prefix in branch name.`);
  + branch = branch.replace(ORIGIN_PREFIX_REGEXP, '');
  + }
  log.debug(
  `git info: ${JSON.stringify({
  