* `git ls-files -z -s -t`, expanding submodules where git allows it. * * `--recurse-submodules` could not be combined with `-s` before git 2.36: * `builtin/ls-files.c` listed `show_stage` among the modes that die, and the * check is unconditional — it does not look at whether the repo actually h
(gitOpts: Parameters<typeof execFileSync>[2])
| 1346 | * bits, and embedded repos are reached through the gitlink recursion anyway. |
| 1347 | */ |
| 1348 | function lsFilesStaged(gitOpts: Parameters<typeof execFileSync>[2]): string { |
| 1349 | try { |
| 1350 | return execFileSync('git', ['ls-files', '-z', '-s', '-t', '--recurse-submodules'], gitOpts) as unknown as string; |
| 1351 | } catch { |
| 1352 | return execFileSync('git', ['ls-files', '-z', '-s', '-t'], gitOpts) as unknown as string; |
| 1353 | } |
| 1354 | } |
| 1355 | |
| 1356 | /** Whether an {@link lsFilesStaged} entry, `<tag> <mode> <object> <stage>\t<path>`, is a gitlink. */ |
| 1357 | function isGitlinkEntry(entry: string): boolean { |
no outgoing calls
no test coverage detected