eslint-plugin-diff
eslint-plugin-diff copied to clipboard
Fix handling of explicit references to baseline commit
In cases where ESLINT_PLUGIN_DIFF_COMMIT is a commit hash, it would get prefixed with "origin/" to generate a string that does not resolve as a git ref. A similar operation would happen with a namespace-qualified ref - refs/heads/origin/main -> origin/refs/heads/main also yields a string that doesn't function as a ref.
This changes to detect cases where the provided ref is more explicit, and disables the origin/ prefixing in those cases.
/cc @paleite