| ... | @@ -47,6 +47,12 @@ const RANGE_DIFF_SUMMARY_MAX_OUTPUT_BYTES = 19_000; | ... | @@ -47,6 +47,12 @@ const RANGE_DIFF_SUMMARY_MAX_OUTPUT_BYTES = 19_000; |
| 47 | const RANGE_DIFF_PATCH_MAX_OUTPUT_BYTES = 59_000; | 47 | const RANGE_DIFF_PATCH_MAX_OUTPUT_BYTES = 59_000; |
| 48 | const WORKSPACE_FILES_MAX_OUTPUT_BYTES = 16 * 1024 * 1024; | 48 | const WORKSPACE_FILES_MAX_OUTPUT_BYTES = 16 * 1024 * 1024; |
| 49 | const GIT_CHECK_IGNORE_MAX_STDIN_BYTES = 256 * 1024; | 49 | const GIT_CHECK_IGNORE_MAX_STDIN_BYTES = 256 * 1024; |
| | 50 | const WORKSPACE_GIT_HARDENED_CONFIG_ARGS = [ |
| | 51 | "-c", |
| | 52 | "core.fsmonitor=false", |
| | 53 | "-c", |
| | 54 | "core.untrackedCache=false", |
| | 55 | ] as const; |
| 50 | const STATUS_UPSTREAM_REFRESH_INTERVAL = Duration.seconds(15); | 56 | const STATUS_UPSTREAM_REFRESH_INTERVAL = Duration.seconds(15); |
| 51 | const STATUS_UPSTREAM_REFRESH_TIMEOUT = Duration.seconds(5); | 57 | const STATUS_UPSTREAM_REFRESH_TIMEOUT = Duration.seconds(5); |
| 52 | const STATUS_UPSTREAM_REFRESH_FAILURE_COOLDOWN = Duration.seconds(5); | 58 | const STATUS_UPSTREAM_REFRESH_FAILURE_COOLDOWN = Duration.seconds(5); |
| ... | @@ -1619,7 +1625,14 @@ export const makeGitCore = Effect.fn("makeGitCore")(function* (options?: { | ... | @@ -1619,7 +1625,14 @@ export const makeGitCore = Effect.fn("makeGitCore")(function* (options?: { |
| 1619 | executeGit( | 1625 | executeGit( |
| 1620 | "GitCore.listWorkspaceFiles", | 1626 | "GitCore.listWorkspaceFiles", |
| 1621 | cwd, | 1627 | cwd, |
| 1622 | ["ls-files", "--cached", "--others", "--exclude-standard", "-z"], | 1628 | [ |
| | 1629 | ...WORKSPACE_GIT_HARDENED_CONFIG_ARGS, |
| | 1630 | "ls-files", |
| | 1631 | "--cached", |
| | 1632 | "--others", |
| | 1633 | "--exclude-standard", |
| | 1634 | "-z", |
| | 1635 | ], |
| 1623 | { | 1636 | { |
| 1624 | allowNonZeroExit: true, | 1637 | allowNonZeroExit: true, |
| 1625 | timeoutMs: 20_000, | 1638 | timeoutMs: 20_000, |
| ... | @@ -1637,7 +1650,14 @@ export const makeGitCore = Effect.fn("makeGitCore")(function* (options?: { | ... | @@ -1637,7 +1650,14 @@ export const makeGitCore = Effect.fn("makeGitCore")(function* (options?: { |
| 1637 | createGitCommandError( | 1650 | createGitCommandError( |
| 1638 | "GitCore.listWorkspaceFiles", | 1651 | "GitCore.listWorkspaceFiles", |
| 1639 | cwd, | 1652 | cwd, |
| 1640 | ["ls-files", "--cached", "--others", "--exclude-standard", "-z"], | 1653 | [ |
| | 1654 | ...WORKSPACE_GIT_HARDENED_CONFIG_ARGS, |
| | 1655 | "ls-files", |
| | 1656 | "--cached", |
| | 1657 | "--others", |
| | 1658 | "--exclude-standard", |
| | 1659 | "-z", |
| | 1660 | ], |
| 1641 | result.stderr.trim().length > 0 ? result.stderr.trim() : "git ls-files failed", | 1661 | result.stderr.trim().length > 0 ? result.stderr.trim() : "git ls-files failed", |
| 1642 | ), | 1662 | ), |
| 1643 | ), | 1663 | ), |
| ... | @@ -1657,7 +1677,7 @@ export const makeGitCore = Effect.fn("makeGitCore")(function* (options?: { | ... | @@ -1657,7 +1677,7 @@ export const makeGitCore = Effect.fn("makeGitCore")(function* (options?: { |
| 1657 | const result = yield* executeGit( | 1677 | const result = yield* executeGit( |
| 1658 | "GitCore.filterIgnoredPaths", | 1678 | "GitCore.filterIgnoredPaths", |
| 1659 | cwd, | 1679 | cwd, |
| 1660 | ["check-ignore", "--no-index", "-z", "--stdin"], | 1680 | [...WORKSPACE_GIT_HARDENED_CONFIG_ARGS, "check-ignore", "--no-index", "-z", "--stdin"], |
| 1661 | { | 1681 | { |
| 1662 | stdin: `${chunk.join("\0")}\0`, | 1682 | stdin: `${chunk.join("\0")}\0`, |
| 1663 | allowNonZeroExit: true, | 1683 | allowNonZeroExit: true, |
| ... | @@ -1671,7 +1691,7 @@ export const makeGitCore = Effect.fn("makeGitCore")(function* (options?: { | ... | @@ -1671,7 +1691,7 @@ export const makeGitCore = Effect.fn("makeGitCore")(function* (options?: { |
| 1671 | return yield* createGitCommandError( | 1691 | return yield* createGitCommandError( |
| 1672 | "GitCore.filterIgnoredPaths", | 1692 | "GitCore.filterIgnoredPaths", |
| 1673 | cwd, | 1693 | cwd, |
| 1674 | ["check-ignore", "--no-index", "-z", "--stdin"], | 1694 | [...WORKSPACE_GIT_HARDENED_CONFIG_ARGS, "check-ignore", "--no-index", "-z", "--stdin"], |
| 1675 | result.stderr.trim().length > 0 ? result.stderr.trim() : "git check-ignore failed", | 1695 | result.stderr.trim().length > 0 ? result.stderr.trim() : "git check-ignore failed", |
| 1676 | ); | 1696 | ); |
| 1677 | } | 1697 | } |