# File lib/whiskey_disk.rb, line 90
  def apply_staleness_check(commands)
    needs(:deploy_to, :repository)
    
    check = "cd #{setting(:deploy_to)}; " +
            "ml=\`git log -1 --pretty=format:%H\`; " +
            "mr=\`git ls-remote #{setting(:repository)} refs/heads/#{branch}\`; "
    
    if setting(:deploy_config_to)
      check += "cd #{setting(:deploy_config_to)}; " +
               "cl=\`git log -1 --pretty=format:%H\`; " +
               "cr=\`git ls-remote #{setting(:config_repository)} refs/heads/#{config_branch}\`; "
    end
    
    check += "if [[ $ml != ${mr%%\t*} ]] " +
             (setting(:deploy_config_to) ? "|| [[ $cl != ${cr%%\t*} ]]" : '') +
             "; then #{commands}; else echo \"No changes to deploy.\"; fi"
  end