@anionex/dsh-turn-rewind 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/git.js +8 -1
- package/package.json +1 -1
- package/src/git.ts +8 -1
package/lib/git.js
CHANGED
|
@@ -21,7 +21,14 @@ export async function discoverRepository(cwd, signal) {
|
|
|
21
21
|
throw new ChangeLedgerError('SUBMODULE_UNSUPPORTED', `submodules require independent restore points; unsupported gitlinks: ${submodules.slice(0, 10).join(', ')}`);
|
|
22
22
|
}
|
|
23
23
|
const pathOutput = await git(root, ['ls-files', '-z', '--cached', '--others', '--exclude-standard'], signal);
|
|
24
|
-
|
|
24
|
+
// `ls-files --others` refuses to descend into embedded repositories, such as a
|
|
25
|
+
// linked worktree nested inside this checkout; it reports the directory itself
|
|
26
|
+
// with a trailing slash (for example `nested/`). Those directories are separate
|
|
27
|
+
// checkouts, not files of this worktree, so exclude them from the snapshot
|
|
28
|
+
// inventory instead of rejecting the entry as a non-canonical path.
|
|
29
|
+
const paths = [...new Set(splitNul(pathOutput)
|
|
30
|
+
.filter((path) => !path.endsWith('/'))
|
|
31
|
+
.map(validateRelativePath))].sort(comparePaths);
|
|
25
32
|
const head = trimOptional(await gitOptional(root, ['rev-parse', '--verify', '--quiet', 'HEAD'], signal));
|
|
26
33
|
const branch = trimOptional(await gitOptional(root, ['symbolic-ref', '--quiet', '--short', 'HEAD'], signal));
|
|
27
34
|
const stagedOutput = await git(root, ['diff', '--cached', '--name-only', '-z'], signal);
|
package/package.json
CHANGED
package/src/git.ts
CHANGED
|
@@ -37,7 +37,14 @@ export async function discoverRepository(cwd: string, signal?: AbortSignal): Pro
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const pathOutput = await git(root, ['ls-files', '-z', '--cached', '--others', '--exclude-standard'], signal)
|
|
40
|
-
|
|
40
|
+
// `ls-files --others` refuses to descend into embedded repositories, such as a
|
|
41
|
+
// linked worktree nested inside this checkout; it reports the directory itself
|
|
42
|
+
// with a trailing slash (for example `nested/`). Those directories are separate
|
|
43
|
+
// checkouts, not files of this worktree, so exclude them from the snapshot
|
|
44
|
+
// inventory instead of rejecting the entry as a non-canonical path.
|
|
45
|
+
const paths = [...new Set(splitNul(pathOutput)
|
|
46
|
+
.filter((path) => !path.endsWith('/'))
|
|
47
|
+
.map(validateRelativePath))].sort(comparePaths)
|
|
41
48
|
const head = trimOptional(await gitOptional(root, ['rev-parse', '--verify', '--quiet', 'HEAD'], signal))
|
|
42
49
|
const branch = trimOptional(await gitOptional(root, ['symbolic-ref', '--quiet', '--short', 'HEAD'], signal))
|
|
43
50
|
const stagedOutput = await git(root, ['diff', '--cached', '--name-only', '-z'], signal)
|