translate reference into hash while reading a commit