packages/cli: treat untracked input dirs as dirty

This commit is contained in:
Patrik Oldsberg
2020-04-07 18:39:08 +02:00
parent 22d7fe5ac5
commit 3bc25560f7
@@ -96,6 +96,10 @@ export class Cache {
for (const quotedInputPath of quotedInputPaths) {
const output = await runPlain(`git ls-tree HEAD ${quotedInputPath}`);
const [, , sha] = output.split(/\s+/, 3);
// If we can't get a tree sha it means we're outside of tracked files, so treat as dirty
if (!sha) {
return undefined;
}
trees.push(sha);
}