Fix object existence check logic using `git cat-file -e <object>`