fix: reject reserved Git HEAD branch
This commit is contained in:
@@ -53,6 +53,11 @@ test("rejects ref-unsafe Git branches", () => {
|
||||
}
|
||||
});
|
||||
|
||||
test("rejects the reserved HEAD branch without rejecting lowercase head", () => {
|
||||
expect(() => loadConfig({ THT_WORKSPACE_GIT_BRANCH: "HEAD" })).toThrow(/branch/i);
|
||||
expect(loadConfig({ THT_WORKSPACE_GIT_BRANCH: "head" }).workspaceRegistry.branch).toBe("head");
|
||||
});
|
||||
|
||||
test("rejects control characters in installation IDs", () => {
|
||||
for (const codePoint of [...Array(0x20).keys(), ...Array(0x21).keys()].map((code, index) => (
|
||||
index < 0x20 ? code : code + 0x7f
|
||||
|
||||
Reference in New Issue
Block a user