resolveDefaultBranch() {
    var _this10 = this;

    return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
      const isLocal = _this10.gitUrl.protocol === FILE_PROTOCOL;

      try {
        let stdout;
        if (isLocal) {
          stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', 'HEAD'], { cwd: _this10.gitUrl.repository });
          const refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(stdout);
          const sha = refs.values().next().value;
          if (sha) {
            return { sha, ref: undefined };
          } else {
            throw new Error('Unable to find SHA for git HEAD');
          }
        } else {
          stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--symref', _this10.gitUrl.repository, 'HEAD']);
          const lines = stdout.split('\n').filter(validRef);

          var _lines$0$split = lines[0].split(/\s+/);

          const ref = _lines$0$split[1];

          var _lines$1$split = lines[1].split(/\s+/);

          const sha = _lines$1$split[0];

          return { sha, ref };
        }
      } catch (err) {
        handleSpawnError(err);
        // older versions of git don't support "--symref"
        const stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', _this10.gitUrl.repository, 'HEAD']);
        const lines = stdout.split('\n').filter(validRef);

        var _lines$0$split2 = lines[0].split(/\s+/);

        const sha = _lines$0$split2[0];

        return { sha, ref: undefined };
      }
    })();
  }
Resolves the default branch of a remote repository (not always "master")