Write win scripts for all levels (with a short, fun trip to quote hell)

This commit is contained in:
Sebastian Morr 2020-09-11 12:23:26 +02:00
parent 2aefdf8391
commit 7c82381e8d
9 changed files with 50 additions and 18 deletions
levels
01-blob
02-tree
03-commit
04-parents

View file

@ -1,7 +1,3 @@
BLOB_COUNT=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep blob | wc -l)
if [ "$BLOB_COUNT" -gt 2 ]; then
exit 0
else
exit 1
fi
test "$BLOB_COUNT" -gt 2

1
levels/02-tree/win Normal file
View file

@ -0,0 +1 @@
git cat-file -p c099013035060f20e8d8f5db69e158213fbec519

3
levels/03-commit/win Normal file
View file

@ -0,0 +1,3 @@
COMMIT_COUNT=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | wc -l)
test "$COMMIT_COUNT" -gt 0

10
levels/04-parents/win Normal file
View file

@ -0,0 +1,10 @@
COMMITS=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | cut -f1 -d" ")
for COMMIT in $COMMITS; do
echo a commit named $COMMIT
if [ $(git rev-list $COMMIT | wc -l) -ge 3 ]; then
exit 0
fi
done
exit 1