mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-06-01 19:19:31 +02:00
Allow multiple level sets, pull out default order into "sequence" file
This commit is contained in:
parent
a9f096636a
commit
5031009dd5
96 changed files with 37 additions and 29 deletions
levels/bottom-up/puzzle-trees-all-the-way-down
18
levels/bottom-up/puzzle-trees-all-the-way-down/win
Normal file
18
levels/bottom-up/puzzle-trees-all-the-way-down/win
Normal file
|
@ -0,0 +1,18 @@
|
|||
TREES=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep tree | cut -f1 -d" ")
|
||||
|
||||
for TREE in $TREES; do
|
||||
if [ "$(git cat-file -p $TREE | wc -l)" -eq 1 ]; then
|
||||
if [ "$(git cat-file -p $TREE | cut -f1 | grep tree | wc -l)" -eq 1 ]; then
|
||||
# So the tree has exactly one child, and it is a tree!
|
||||
TREE2=$(git cat-file -p $TREE | cut -f1 | grep tree | cut -f3 -d" ")
|
||||
if [ "$(git cat-file -p $TREE2 | wc -l)" -eq 1 ]; then
|
||||
if [ "$(git cat-file -p $TREE2 | cut -f1 | grep tree | wc -l)" -eq 1 ]; then
|
||||
# Same for its child! \o/
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
exit 1
|
Loading…
Add table
Add a link
Reference in a new issue