code: function(repo, gitpathOrOpts) {
    if (!(this instanceof Repository)) {
      return new Repository(repo, gitpathOrOpts);
    }
  
    var self = this;
  
    events.EventEmitter.call(this);
  
    if (utils.isString(gitpathOrOpts)) { // interpret 'opts' string as gitpath
      self.gitpath = path.normalize(gitpathOrOpts);
    }
    if (utils.isObject(gitpathOrOpts)) {
      var opts = gitpathOrOpts;
      if (opts.gitpath) {
        self.gitpath = path.normalize(opts.gitpath);
      }
      self.largeOperations = opts.largeOperations;
      self.largeOperationsMaxBuffer = opts.largeOperationsMaxBuffer;
    }
    self.path = path.normalize(repo);
    self._ready = false;
    self.name = path.basename(self.path);
  
    // apply defaults
    self.gitpath = self.gitpath || '';
    self.largeOperations = self.largeOperations || ['log', 'ls-files'];
    self.largeOperationsMaxBuffer = self.largeOperationsMaxBuffer || 1024 * 5000;
  
    fs.exists(self.path + '/.git', function(exists) {
      self.initialized = exists;
      self._ready = true;
  
      self.emit('ready');
    });
  }
docs: Represents a Git repository.
  Requires 'repo' string identifying the local repository directory.
  Accepts optional 'gitpathOrOpts' that may be a string identifying the
  path to the native git client or an object containing an optional
  'gitpath' property, an optional 'largeOperations' property, and an
  optional 'largeOperationsMaxBuffer'.
  {
  gitpath: a string representing the path to the git client
  largeOperations: array of strings identifying large operations
  largeOperationsMaxBuffer: number, default is 1024 * 5000
  }
  @constructor
  @param {string} repo
  @param {string|object} gitpathOrOpts a 'gitpath' string or opts object