oh-my-git/levels/puzzle-precious-blob/win

11 lines
387 B
Text
Raw Normal View History

2020-09-16 14:16:38 +02:00
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"