[m-rev.] for review: Add sanity check to tools/import_srcdist.

Peter Wang novalazy at gmail.com
Thu Jan 27 17:19:10 AEDT 2022


tools/import_srcdist:
    Check with "git status" that all files in the workspace have been
    added, not ignored.

diff --git a/tools/import_srcdist b/tools/import_srcdist
index 51e861ba8..833d4acf0 100755
--- a/tools/import_srcdist
+++ b/tools/import_srcdist
@@ -51,5 +51,10 @@ git checkout --detach "$initialcommit"
 git clean -fdxq .
 tar xf "$archive" --strip-components=1
 git add -f .
+if git status --porcelain=v1 --ignored | grep -v '^A  '
+then
+    echo "Some files were not added." >&2
+    exit 1
+fi
 git commit -q -m "Imported $basename"
 git tag -a -m "Tag $version" "$tag"
-- 
2.31.0



More information about the reviews mailing list