mirror of
https://github.com/git-learning-game/oh-my-git.git
synced 2025-05-27 20:29:22 +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-precious-blob
1
levels/bottom-up/puzzle-precious-blob/description
Normal file
1
levels/bottom-up/puzzle-precious-blob/description
Normal file
|
@ -0,0 +1 @@
|
|||
Create two trees pointing to the same blob!
|
7
levels/bottom-up/puzzle-precious-blob/goal
Normal file
7
levels/bottom-up/puzzle-precious-blob/goal
Normal file
|
@ -0,0 +1,7 @@
|
|||
BLOB=$(echo "I am precious" | git hash-object -w --stdin)
|
||||
git update-index --add --cacheinfo 100644,$BLOB,a
|
||||
git write-tree
|
||||
git update-index --force-remove a
|
||||
git update-index --add --cacheinfo 100644,$BLOB,b
|
||||
git write-tree
|
||||
git update-index --force-remove b
|
10
levels/bottom-up/puzzle-precious-blob/win
Normal file
10
levels/bottom-up/puzzle-precious-blob/win
Normal file
|
@ -0,0 +1,10 @@
|
|||
TREES=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep tree | cut -f1 -d" ")
|
||||
|
||||
ALL_TREE_CHILDREN=$(for TREE in $TREES; do
|
||||
git cat-file -p $TREE | cut -f1 | cut -f3 -d" "
|
||||
done)
|
||||
|
||||
NUMBER_OF_CHILDREN=$(echo "$ALL_TREE_CHILDREN" | wc -l)
|
||||
UNIQUE_CHILDREN=$(echo "$ALL_TREE_CHILDREN" | sort -u | wc -l)
|
||||
|
||||
test "$NUMBER_OF_CHILDREN" -gt "$UNIQUE_CHILDREN"
|
Loading…
Add table
Add a link
Reference in a new issue