Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(shared): recognize numeric bare-repository config #27500

Mergedmacodev00(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/27500/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 57 additions and 1 deletion.

x
0 of 2 viewed, 2 left
41 additions and 0 deletionspackages/shared/src/git.test.tsModified
View file
@@ -66,6 +66,47 @@
});
​
describe("isBareGitConfig", () => {
+ it("reads Git's numeric booleans without accepting invalid or overflowing values", () => {
+ for (const value of [
+ "true",
+ "yes",
+ "on",
+ "1",
+ "2",
+ "-1",
+ "+1",
+ "01",
+ "0x10",
+ "1k",
+ "1m",
+ "1g",
+ "2147483647",
+ "-2147483648",
+ ]) {
+ expect(isBareGitConfig(`[core]\nbare = ${value}\n`), value).toBe(true);
+ }
+ for (const value of [
+ "false",
+ "no",
+ "off",
+ "0",
+ "-0",
+ "00",