(url)
| 35739 | } |
| 35740 | |
| 35741 | getRefOverHTTP(url) { |
| 35742 | var _this = this; |
| 35743 | |
| 35744 | return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { |
| 35745 | const gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url); |
| 35746 | const client = new (_git || _load_git()).default(_this.config, gitUrl, _this.hash); |
| 35747 | |
| 35748 | let out = yield _this.config.requestManager.request({ |
| 35749 | url: `${url}/info/refs?service=git-upload-pack`, |
| 35750 | queue: _this.resolver.fetchingQueue |
| 35751 | }); |
| 35752 | |
| 35753 | if (out) { |
| 35754 | // clean up output |
| 35755 | let lines = out.trim().split('\n'); |
| 35756 | |
| 35757 | // remove first two lines which contains compatibility info etc |
| 35758 | lines = lines.slice(2); |
| 35759 | |
| 35760 | // remove last line which contains the terminator "0000" |
| 35761 | lines.pop(); |
| 35762 | |
| 35763 | // remove line lengths from start of each line |
| 35764 | lines = lines.map(function (line) { |
| 35765 | return line.slice(4); |
| 35766 | }); |
| 35767 | |
| 35768 | out = lines.join('\n'); |
| 35769 | } else { |
| 35770 | throw new Error(_this.reporter.lang('hostedGitResolveError')); |
| 35771 | } |
| 35772 | |
| 35773 | return client.setRefHosted(out); |
| 35774 | })(); |
| 35775 | } |
| 35776 | |
| 35777 | resolveOverHTTP(url) { |
| 35778 | var _this2 = this; |
no test coverage detected