Fixed a reference error with git_post.
Added some checks on variables.
Correct code style.
Merge pull request #148 from cojennin/fix-ref-error

Fixed a reference error with get_post.