mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-13 11:57:19 +01:00
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:
1 parent
4399e40b5d
commit
73a7267aa6
6 files changed
+25
-13
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user