diff-scope: fail-safe auth match; resolveBase never re-qualifies a remote-qualified base (GST-1065, GST-1036)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-11-03 03:19:06 +00:00
1 parent 4399e40b5d
commit 73a7267aa6
6 files changed
+25 -13

No files matched your search

+2 -1
View File
@@ -109,8 +109,9 @@ export function resolveBase(ref: string, cwd: string, head?: string): { ref: str
if (!isBranchName(ref)) { const sha = direct(); return sha ? { ref, sha } : null; }
const qualified = resolvesToCommit(`refs/remotes/` + ref, cwd);
if (qualified) return { ref, sha: qualified };
const local = resolvesToCommit(`refs/heads/` + ref, cwd);
const remotes = remoteNames(cwd);
if (remotes.some((remote) => ref.startsWith(remote + '/'))) return null;
const local = resolvesToCommit(`refs/heads/` + ref, cwd);
const localRelated = !!local && related(local);
const twin = (remote: string) => {
const sha = resolvesToCommit(`refs/remotes/` + remote + '/' + ref, cwd);