creationix/wheat — pull request #45 by austinyun (2012-07-04 00:45:15+00:00)
Title: Is Git.getHead() necessary in wheat.js?

WARNING: If this has something to do with cacheing / the "safe" function in Git, I have no idea, because I honestly don't understand that stuff at all.

Makes an if/else branch unnecessary.

I've tested this on a clone of howtonode.org and it seems to work.

I believe Git.getHead() should always return fs, because my understanding is that the HEAD in Git only moves on checkouts and commits?

I stuck a console.log(sha) in a clone of howtonode.org and clicked all over the site and never got anything but fs. Besides that, the only place the head seems to be used anywhere in wheat is on reading the "description.markdown" file. I figured the lines might have something to do with reading the same version of other files (eg. authors.markdown) that were in place at the time of that particular commit, but behavior seems to be the same with the patch in place.