MCPcopy
hub / github.com/Kong/insomnia / getRefOverHTTP

Method getRefOverHTTP

packages/insomnia/bin/yarn-standalone.js:35307–35341  ·  view source on GitHub ↗
(url)

Source from the content-addressed store, hash-verified

35305 }
35306
35307 getRefOverHTTP(url) {
35308 var _this = this;
35309
35310 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
35311 const gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url);
35312 const client = new (_git || _load_git()).default(_this.config, gitUrl, _this.hash);
35313
35314 let out = yield _this.config.requestManager.request({
35315 url: `${url}/info/refs?service=git-upload-pack`,
35316 queue: _this.resolver.fetchingQueue
35317 });
35318
35319 if (out) {
35320 // clean up output
35321 let lines = out.trim().split('\n');
35322
35323 // remove first two lines which contains compatibility info etc
35324 lines = lines.slice(2);
35325
35326 // remove last line which contains the terminator "0000"
35327 lines.pop();
35328
35329 // remove line lengths from start of each line
35330 lines = lines.map(function (line) {
35331 return line.slice(4);
35332 });
35333
35334 out = lines.join('\n');
35335 } else {
35336 throw new Error(_this.reporter.lang('hostedGitResolveError'));
35337 }
35338
35339 return client.setRefHosted(out);
35340 })();
35341 }
35342
35343 resolveOverHTTP(url) {
35344 var _this2 = this;

Callers 1

resolveOverHTTPMethod · 0.80

Calls 6

_load_asyncToGeneratorFunction · 0.85
_load_gitFunction · 0.85
npmUrlToGitUrlMethod · 0.80
setRefHostedMethod · 0.80
requestMethod · 0.45
langMethod · 0.45

Tested by

no test coverage detected