oh-my-git/levels/internals/commit-rhombus/win

11 lines
369 B
Text
Raw Normal View History

2020-09-15 16:32:00 +02:00
COMMITS=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | cut -f1 -d" ")
for COMMIT in $COMMITS; do
# My first parent's parents has to be the same as my second parent's parent.
if [ "$(git rev-parse --verify -q $COMMIT^1^)" = "$(git rev-parse --verify -q $COMMIT^2^)" ]; then
return 0
2020-09-15 16:32:00 +02:00
fi
done
return 1