Fix branch selection logic for git deploys

* Before, because the logic was revered (see
 c0e46393c656eac6e47a83f54041457e3c6a6923), a brand new deploy would
 result in assuming that the deploy branch existed when it actually
 did not. This would cause initial deploys to fail.
* This new logic is more concise, more readable, and still backwards
 compatible with ruby 1.8.