dcrec1/inploy — pull request #34 by svoop (2011-12-21 11:23:35+00:00)
Title: New before_git callback

The after_git callback from a recent pull request is useful to e.g. copy files like database.yml from a template directory on the server after git has cloned/updated/reset code. However, you will bump into trouble if you use it overwrite a file which is in the git repo (e.g. an initializer). Subsequent updates might fail since the local working tree is dirty.

An easy fix for this is to issue a "git checkout ." before the git update/reset happens. (It's not useful nor easy to impliment before a git clone.) But instead of hardcoding it, I've added a bro for the after_git callback - the before_git callback. The default behavior is therefore not altered at all.

(The second commit is a fix for a faulty yet passing test of the after_git callback.)