use ref.commit to get commit from ref

This pull request will be closed the Issue #57 .