fix(FN-5456): tidy autocorrect shell quoting and disambiguate checkout
- Hoist `refs/heads/<name>` into a single quoted token before the verify call so the shell-quote boundary is unambiguous in the rendered command. - Append `--` to the recovery `git checkout` so a same-named tracked path cannot win the DWIM resolution. The ref existence was already verified, so this can only resolve as the branch. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -87,8 +87,8 @@ describe("attemptBranchAutocorrect", () => {
|
||||
expect(result).toEqual({ status: "checked-out" });
|
||||
expect(mockedExec.mock.calls.map((c: unknown[]) => c[0])).toEqual([
|
||||
"git rev-parse --abbrev-ref --symbolic-full-name 'lemon-sage'@{u}",
|
||||
"git show-ref --verify --quiet refs/heads/'fusion/fn-2'",
|
||||
"git checkout 'fusion/fn-2'",
|
||||
"git show-ref --verify --quiet 'refs/heads/fusion/fn-2'",
|
||||
"git checkout 'fusion/fn-2' --",
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user