| ... | ... | @@ -931,6 +931,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 931 | 931 | cwd: commandInput.cwd, |
| 932 | 932 | env: { |
| 933 | 933 | ...process.env, |
| 934 | // Status polling runs beside the user's own git commands; without this, |
| 935 | // `git status` takes index.lock to save its refreshed index. |
| 936 | GIT_OPTIONAL_LOCKS: "0", |
| 934 | 937 | ...input.env, |
| 935 | 938 | ...trace2Monitor.env, |
| 936 | 939 | }, |
| ... | ... | @@ -1875,10 +1878,12 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 1875 | 1878 | const statusCacheKey = repositoryPaths?.gitCommonDir; |
| 1876 | 1879 | const [numstatStdout, defaultBranch, hasPrimaryRemote] = yield* Effect.all( |
| 1877 | 1880 | [ |
| 1881 | // Plumbing, because porcelain `git diff` rewrites the index even with |
| 1882 | // GIT_OPTIONAL_LOCKS=0. -M keeps porcelain's rename detection. |
| 1878 | 1883 | executeGitWithStableDiagnostics( |
| 1879 | 1884 | "GitVcsDriver.statusDetails.numstat", |
| 1880 | 1885 | cwd, |
| 1881 | | ["diff", "HEAD", "--numstat", "--"], |
| 1886 | ["diff-index", "-M", "--numstat", "HEAD", "--"], |
| 1882 | 1887 | { allowNonZeroExit: true }, |
| 1883 | 1888 | ).pipe( |
| 1884 | 1889 | Effect.flatMap((result) => { |
| ... | ... | @@ -1887,7 +1892,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 1887 | 1892 | return Effect.map( |
| 1888 | 1893 | Effect.all([ |
| 1889 | 1894 | runGitStdout("GitVcsDriver.statusDetails.numstat.unborn", cwd, [ |
| 1890 | | "diff", |
| 1895 | "diff-files", |
| 1891 | 1896 | "--numstat", |
| 1892 | 1897 | ]), |
| 1893 | 1898 | runGitStdout("GitVcsDriver.statusDetails.numstat.unborn.staged", cwd, [ |
| ... | ... | @@ -1920,9 +1925,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 1920 | 1925 | ...gitCommandContext({ |
| 1921 | 1926 | operation: "GitVcsDriver.statusDetails.numstat", |
| 1922 | 1927 | cwd, |
| 1923 | | args: ["diff", "HEAD", "--numstat", "--"], |
| 1928 | args: ["diff-index", "-M", "--numstat", "HEAD", "--"], |
| 1924 | 1929 | }), |
| 1925 | | detail: "git diff HEAD --numstat failed.", |
| 1930 | detail: "git diff-index HEAD --numstat failed.", |
| 1926 | 1931 | exitCode: result.exitCode, |
| 1927 | 1932 | stdoutLength: result.stdout.length, |
| 1928 | 1933 | stderrLength: result.stderr.length, |