fix: fetch git installer branch refs without tags

This commit is contained in:
Peter Steinberger
2026-05-15 04:08:56 +01:00
parent b26dcb3390
commit a9aafc84b1
4 changed files with 38 additions and 18 deletions
+10 -1
View File
@@ -47,9 +47,18 @@ describe("install-cli.sh", () => {
expect(result.stdout).toContain("main=main");
});
it("fetches main without tags for git installs", () => {
it("fetches moving git refs without tags for git installs", () => {
expect(script).toContain('git -C "$repo_dir" fetch --no-tags origin main');
expect(script).toContain(
'git -C "$repo_dir" fetch --no-tags origin "refs/heads/${ref}:refs/remotes/origin/${ref}"',
);
expect(script).toContain('git -C "$repo_dir" pull --rebase --no-tags || true');
const branchCheckIndex = script.indexOf('ls-remote --exit-code --heads origin "$ref"');
const tagFetchIndex = script.indexOf("fetch --tags origin");
expect(branchCheckIndex).toBeGreaterThan(-1);
expect(tagFetchIndex).toBeGreaterThan(-1);
expect(branchCheckIndex).toBeLessThan(tagFetchIndex);
});
it("uses non-frozen lockfile installs only for moving git refs", () => {