You are here

function _drush_coder_git_path in Coder 7.2

Get the git path.

1 call to _drush_coder_git_path()
_drush_coder_review_git in coder_review/coder_review.drush.inc
Install coder as a git pre-commit hook.

File

coder_review/coder_review.drush.inc, line 242
Command line utility support for Coder_review module.

Code

function _drush_coder_git_path() {
  static $gitpath;
  if (empty($gitpath)) {
    $path = drush_cwd();
    while (TRUE) {
      if (is_dir("{$path}/.git")) {
        $gitpath = "{$path}/.git";
        break;
      }
      if ($path == DRUPAL_ROOT) {
        break;
      }
      $path = realpath("{$path}/..");
    }
  }
  return $gitpath;
}