From 71c50c0e2ab4b931a456c3e2e82f271c5cd58608 Mon Sep 17 00:00:00 2001 From: subskribe-kevin <111385429+subskribe-kevin@users.noreply.github.com> Date: Tue, 13 Dec 2022 09:38:23 -0500 Subject: [PATCH] Update processors.ts Do not automagically add origin/ to the branch name. If the user wants to user origin/ they can add it themselves. This prevents: fatal: ambiguous argument 'origin/my_branch': unknown revision or path not in the working tree. --- src/processors.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/processors.ts b/src/processors.ts index 753c98a..6cef544 100644 --- a/src/processors.ts +++ b/src/processors.ts @@ -13,10 +13,8 @@ import type { Range } from "./Range"; if (process.env.CI !== undefined) { const branch = process.env.ESLINT_PLUGIN_DIFF_COMMIT ?? guessBranch(); if (branch !== undefined) { - const branchWithoutOrigin = branch.replace(/^origin\//, ""); - const branchWithOrigin = `origin/${branchWithoutOrigin}`; - fetchFromOrigin(branchWithoutOrigin); - process.env.ESLINT_PLUGIN_DIFF_COMMIT = branchWithOrigin; + fetchFromOrigin(branch); + process.env.ESLINT_PLUGIN_DIFF_COMMIT = branch; } }