| ... | @@ -931,6 +931,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* | ... | @@ -931,6 +931,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 931 | cwd: commandInput.cwd, | 931 | cwd: commandInput.cwd, |
| 932 | env: { | 932 | env: { |
| 933 | ...process.env, | 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 | ...input.env, | 937 | ...input.env, |
| 935 | ...trace2Monitor.env, | 938 | ...trace2Monitor.env, |
| 936 | }, | 939 | }, |
| ... | @@ -1875,10 +1878,12 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* | ... | @@ -1875,10 +1878,12 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 1875 | const statusCacheKey = repositoryPaths?.gitCommonDir; | 1878 | const statusCacheKey = repositoryPaths?.gitCommonDir; |
| 1876 | const [numstatStdout, defaultBranch, hasPrimaryRemote] = yield* Effect.all( | 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 | executeGitWithStableDiagnostics( | 1883 | executeGitWithStableDiagnostics( |
| 1879 | "GitVcsDriver.statusDetails.numstat", | 1884 | "GitVcsDriver.statusDetails.numstat", |
| 1880 | cwd, | 1885 | cwd, |
| 1881 | ["diff", "HEAD", "--numstat", "--"], | 1886 | ["diff-index", "-M", "--numstat", "HEAD", "--"], |
| 1882 | { allowNonZeroExit: true }, | 1887 | { allowNonZeroExit: true }, |
| 1883 | ).pipe( | 1888 | ).pipe( |
| 1884 | Effect.flatMap((result) => { | 1889 | Effect.flatMap((result) => { |
| ... | @@ -1887,7 +1892,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* | ... | @@ -1887,7 +1892,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 1887 | return Effect.map( | 1892 | return Effect.map( |
| 1888 | Effect.all([ | 1893 | Effect.all([ |
| 1889 | runGitStdout("GitVcsDriver.statusDetails.numstat.unborn", cwd, [ | 1894 | runGitStdout("GitVcsDriver.statusDetails.numstat.unborn", cwd, [ |
| 1890 | "diff", | 1895 | "diff-files", |
| 1891 | "--numstat", | 1896 | "--numstat", |
| 1892 | ]), | 1897 | ]), |
| 1893 | runGitStdout("GitVcsDriver.statusDetails.numstat.unborn.staged", cwd, [ | 1898 | runGitStdout("GitVcsDriver.statusDetails.numstat.unborn.staged", cwd, [ |
| ... | @@ -1920,9 +1925,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* | ... | @@ -1920,9 +1925,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 1920 | ...gitCommandContext({ | 1925 | ...gitCommandContext({ |
| 1921 | operation: "GitVcsDriver.statusDetails.numstat", | 1926 | operation: "GitVcsDriver.statusDetails.numstat", |
| 1922 | cwd, | 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 | exitCode: result.exitCode, | 1931 | exitCode: result.exitCode, |
| 1927 | stdoutLength: result.stdout.length, | 1932 | stdoutLength: result.stdout.length, |
| 1928 | stderrLength: result.stderr.length, | 1933 | stderrLength: result.stderr.length, |