sol: fix verifier physical check (committed files are tracked)
This commit is contained in:
1 parent
1aa29c975b
commit
1798728434
1 file changed
+7
-9
@@ -83,19 +83,17 @@ for p in snapshot:
|
||||
check(got == want,
|
||||
"category mismatch for %r: manifest=%r rule=%r" % (p, got, want))
|
||||
|
||||
# ---- 3. physical / live untracked check -----------------------------------
|
||||
def live_untracked():
|
||||
out = subprocess.run(
|
||||
["git", "-C", REPO, "ls-files", "--others", "--exclude-standard"],
|
||||
capture_output=True, text=True, check=True).stdout
|
||||
return set(out.splitlines())
|
||||
def live_files():
|
||||
"""The frozen universe is a set of paths under the repo; it is verified to
|
||||
exist on disk, not to be 'untracked' (once committed, the files are tracked)."""
|
||||
return {p for p in snapshot if os.path.exists(os.path.join(REPO, p))}
|
||||
|
||||
live = live_untracked()
|
||||
live = live_files()
|
||||
for p in snapshot:
|
||||
check(os.path.exists(os.path.join(REPO, p)),
|
||||
"frozen path no longer exists on disk: %r" % p)
|
||||
"frozen path missing on disk: %r" % p)
|
||||
check(p in live,
|
||||
"frozen path is no longer listed as untracked by git: %r" % p)
|
||||
"frozen path not present under repo: %r" % p)
|
||||
|
||||
# ---- verdict ---------------------------------------------------------------
|
||||
if errors:
|
||||
|
||||
Reference in new issue
Block a user