monorepo-next 8.3.1 → 8.3.2
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/package.json +1 -1
- package/src/build-change-graph.js +7 -12
package/package.json
CHANGED
@@ -21,22 +21,17 @@ async function getPackageChangedFiles({
|
|
21
21
|
packageCwd,
|
22
22
|
options,
|
23
23
|
}) {
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
let
|
28
|
-
if (isAncestor) {
|
29
|
-
olderCommit = fromCommit;
|
30
|
-
newerCommit = toCommit;
|
31
|
-
} else {
|
32
|
-
olderCommit = toCommit;
|
33
|
-
newerCommit = fromCommit;
|
34
|
-
}
|
24
|
+
// Be careful you don't accidentally use `...` instead of `..`.
|
25
|
+
// `...` finds the merge-base and uses that instead of `fromCommit`.
|
26
|
+
// https://stackoverflow.com/a/60496462
|
27
|
+
let committedChanges = await git(['diff', '--name-only', `${fromCommit}..${toCommit}`, packageCwd], options);
|
35
28
|
|
36
|
-
let committedChanges = await git(['diff', '--name-only', `${olderCommit}...${newerCommit}`, packageCwd], options);
|
37
29
|
committedChanges = getLinesFromOutput(committedChanges);
|
30
|
+
|
38
31
|
let dirtyChanges = await git(['status', '--porcelain', packageCwd, '-u'], options);
|
32
|
+
|
39
33
|
dirtyChanges = getLinesFromOutput(dirtyChanges).map(line => line.substr(3));
|
34
|
+
|
40
35
|
let changedFiles = Array.from(new Set(committedChanges).union(dirtyChanges));
|
41
36
|
|
42
37
|
return changedFiles;
|