That's pretty good, but it can be simplified further by pulling the `allow` check out of the loop (no need to check each time through) and by making it count down from `@max_retries`. Ruby has a handy `times` method for that, so my previous suggestion for a variable called `remaining_retries` isn't actually even needed.

```ruby
def git(command, check_errors=true)
  unless allow?
    raise GitError, "Bundler is trying to run a `git #{command}` at runtime. You probably need to run `bundle install`. However, " \
                  "this error message could probably be more useful. Please submit a ticket at http://github.com/bundler/bundler/issues " \
                  "with steps to reproduce as well as the following\n\nCALLER: #{caller.join("\n")}"
  end
  @max_retries.times do
    out = %x{git #{command}}
    return out unless check_errors && $?.exitstatus != 0
  end
  msg = "Git error: command `git #{command}` in directory #{Dir.pwd} has failed."
  msg << "\nIf this error persists you could try removing the cache directory '#{path}'" if path.exist?
  raise GitError, msg
end
```

(untested, but something along those lines)