Guest User

Untitled

a guest
Mar 10th, 2014
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var modules = {};
  2.  
  3. var defs = {};
  4.  
  5. defs["src/core.js"] = function (module, exports) {
  6. // This is the core recipe.  Feel free to change any piece with a new
  7. // implementation and re-generate the jsgit.js script using the `make.js`
  8. // tool in the root of this repo.
  9.  
  10. // Some of these libraries assume setImmediate exists.  Let's polyfill it!
  11. if (!window.setImmediate) window.setImmediate = require('lib/defer.js');
  12.  
  13. var platform = {
  14.   sha1: require('node_modules/git-sha1/sha1.js'),
  15.   bops: require('lib/bops/index.js'),
  16.   tcp: require('node_modules/websocket-tcp-client/web-tcp.js').tcp,
  17.   tls: require('node_modules/websocket-tcp-client/web-tcp.js').tls,
  18.   // Uncomment these to enable zlib compression of the values
  19.   // This is a time/space tradeoff.
  20.   // inflate: require('git-zlib/inflate.js'),
  21.   // deflate: require('git-zlib/deflate.js'),
  22. };
  23. platform.http = require('node_modules/git-http/pure-http.js')(platform);
  24.  
  25. window.jsgit = {
  26.   repo: require('node_modules/js-git/js-git.js')(platform),
  27.   remote: require('node_modules/git-net/remote.js')(platform),
  28.   db: require('git-localdb')(platform),
  29.   // Uncomment to switch to an in-memory database for quick testing.
  30.   // db: require('git-memdb'),
  31.   version: require('node_modules/js-git/package.json').version
  32. };
  33. };
  34.  
  35. defs["lib/defer.js"] = function (module, exports) {
  36. var timeouts = [];
  37. var messageName = "zero-timeout-message";
  38.  
  39. function handleMessage(event) {
  40.   if (event.source == window && event.data == messageName) {
  41.     event.stopPropagation();
  42.     if (timeouts.length > 0) {
  43.       var fn = timeouts.shift();
  44.       fn();
  45.     }
  46.   }
  47. }
  48.  
  49. window.addEventListener("message", handleMessage, true);
  50.  
  51. module.exports = function (fn) {
  52.   timeouts.push(fn);
  53.   window.postMessage(messageName, "*");
  54. };
  55. };
  56.  
  57. defs["node_modules/git-sha1/sha1.js"] = function (module, exports) {
  58. module.exports = sha1;
  59.  
  60. function sha1(buffer) {
  61.   if (buffer === undefined) return create();
  62.   var shasum = create();
  63.   shasum.update(buffer);
  64.   return shasum.digest();
  65. }
  66.  
  67. // A streaming interface for when nothing is passed in.
  68. function create() {
  69.   var h0 = 0x67452301;
  70.   var h1 = 0xEFCDAB89;
  71.   var h2 = 0x98BADCFE;
  72.   var h3 = 0x10325476;
  73.   var h4 = 0xC3D2E1F0;
  74.   // The first 64 bytes (16 words) is the data chunk
  75.   var block = new Uint32Array(80), offset = 0, shift = 24;
  76.   var totalLength = 0;
  77.  
  78.   return { update: update, digest: digest };
  79.  
  80.   // The user gave us more data.  Store it!
  81.   function update(chunk) {
  82.     if (typeof chunk === "string") return updateString(chunk);
  83.     var length = chunk.length;
  84.     totalLength += length * 8;
  85.     for (var i = 0; i < length; i++) {
  86.       write(chunk[i]);
  87.     }
  88.   }
  89.  
  90.   function updateString(string) {
  91.     var encoded = unescape(encodeURIComponent(string));
  92.     var length = encoded.length;
  93.     totalLength += length * 8;
  94.     for (var i = 0; i < length; i++) {
  95.       write(encoded.charCodeAt(i));
  96.     }
  97.   }
  98.  
  99.   function write(byte) {
  100.     block[offset] |= (byte & 0xff) << shift;
  101.     if (shift) {
  102.       shift -= 8;
  103.     }
  104.     else {
  105.       offset++;
  106.       shift = 24;
  107.     }
  108.     if (offset === 16) processBlock();
  109.   }
  110.  
  111.   // No more data will come, pad the block, process and return the result.
  112.   function digest() {
  113.     // Pad
  114.     write(0x80);
  115.     if (offset > 14 || (offset === 14 && shift < 24)) {
  116.       processBlock();
  117.     }
  118.     offset = 14;
  119.     shift = 24;
  120.  
  121.     // 64-bit length big-endian
  122.     write(0x00); // numbers this big aren't accurate in javascript anyway
  123.     write(0x00); // ..So just hard-code to zero.
  124.     write(totalLength > 0xffffffffff ? totalLength / 0x10000000000 : 0x00);
  125.     write(totalLength > 0xffffffff ? totalLength / 0x100000000 : 0x00);
  126.     for (var s = 24; s >= 0; s -= 8) {
  127.       write(totalLength >> s);
  128.     }
  129.  
  130.     // At this point one last processBlock() should trigger and we can pull out the result.
  131.     return toHex(h0)
  132.          + toHex(h1)
  133.          + toHex(h2)
  134.          + toHex(h3)
  135.          + toHex(h4);
  136.   }
  137.  
  138.   // We have a full block to process.  Let's do it!
  139.   function processBlock() {
  140.     // Extend the sixteen 32-bit words into eighty 32-bit words:
  141.     for (var i = 16; i < 80; i++) {
  142.       var w = block[i - 3] ^ block[i - 8] ^ block[i - 14] ^ block[i - 16];
  143.       block[i] = (w << 1) | (w >>> 31);
  144.     }
  145.  
  146.     // log(block);
  147.  
  148.     // Initialize hash value for this chunk:
  149.     var a = h0;
  150.     var b = h1;
  151.     var c = h2;
  152.     var d = h3;
  153.     var e = h4;
  154.     var f, k;
  155.  
  156.     // Main loop:
  157.     for (i = 0; i < 80; i++) {
  158.       if (i < 20) {
  159.         f = d ^ (b & (c ^ d));
  160.         k = 0x5A827999;
  161.       }
  162.       else if (i < 40) {
  163.         f = b ^ c ^ d;
  164.         k = 0x6ED9EBA1;
  165.       }
  166.       else if (i < 60) {
  167.         f = (b & c) | (d & (b | c));
  168.         k = 0x8F1BBCDC;
  169.       }
  170.       else {
  171.         f = b ^ c ^ d;
  172.         k = 0xCA62C1D6;
  173.       }
  174.       var temp = (a << 5 | a >>> 27) + f + e + k + block[i];
  175.       e = d;
  176.       d = c;
  177.       c = (b << 30 | b >>> 2);
  178.       b = a;
  179.       a = temp;
  180.     }
  181.  
  182.     // Add this chunk's hash to result so far:
  183.     h0 = (h0 + a) | 0;
  184.     h1 = (h1 + b) | 0;
  185.     h2 = (h2 + c) | 0;
  186.     h3 = (h3 + d) | 0;
  187.     h4 = (h4 + e) | 0;
  188.  
  189.     // The block is now reusable.
  190.     offset = 0;
  191.     for (i = 0; i < 16; i++) {
  192.       block[i] = 0;
  193.     }
  194.   }
  195.  
  196.   function toHex(word) {
  197.     var hex = "";
  198.     for (var i = 28; i >= 0; i -= 4) {
  199.       hex += ((word >> i) & 0xf).toString(16);
  200.     }
  201.     return hex;
  202.   }
  203.  
  204. }
  205.  
  206. /*
  207. // Uncomment to test in node.js
  208.  
  209. var assert = require('assert');
  210. var tests = [
  211.   "", "da39a3ee5e6b4b0d3255bfef95601890afd80709",
  212.   "a", "86f7e437faa5a7fce15d1ddcb9eaeaea377667b8",
  213.   "abc", "a9993e364706816aba3e25717850c26c9cd0d89d",
  214.   "message digest", "c12252ceda8be8994d5fa0290a47231c1d16aae3",
  215.   "abcdefghijklmnopqrstuvwxyz", "32d10c7b8cf96570ca04ce37f2a19d84240d3a89",
  216.   "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
  217.     "84983e441c3bd26ebaae4aa1f95129e5e54670f1",
  218.   "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabc",
  219.     "a6319f25020d5ff8722d40ae750dbab67d94fe4f",
  220.   "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZab",
  221.     "edb3a03256d1c6d148034ec4795181931c933f46",
  222.   "abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZa",
  223.     "677734f7bf40b2b244cae100bf365598fbf4741d",
  224. ]
  225.  
  226. for (var i = 0; i < tests.length; i += 2) {
  227.   var input = tests[i];
  228.   console.log("\n" + JSON.stringify(input));
  229.   var expectedHex = tests[i + 1];
  230.   console.log(expectedHex);
  231.   var hash = sha1(input);
  232.   console.log(hash);
  233.   if (hash !== expectedHex) {
  234.     throw new Error(hash + " != " + expectedHex + " for '" + input + "'");
  235.   }
  236.   var sha1sum = sha1();
  237.   for (var j = 0, l = input.length; j < l; j += 17) {
  238.     sha1sum.update(input.substr(j, 17));
  239.   }
  240.   hash = sha1sum.digest();
  241.   console.log(hash);
  242.   if (hash !== expectedHex) {
  243.     throw new Error(hash + " != " + expectedHex + " for '" + input + "'");
  244.   }
  245. }
  246.  
  247. console.log("\n1,000,000 repetitions of the character 'a'");
  248. var expectedHex = "34aa973cd4c4daa4f61eeb2bdbad27316534016f";
  249. console.log(expectedHex);
  250. var sha1sum = sha1();
  251. for (var i = 0; i < 100000; i++) {
  252.   sha1sum.update("aaaaaaaaaa");
  253. }
  254. var hash = sha1sum.digest();
  255. console.log(hash);
  256. if (hash !== expectedHex) {
  257.   throw new Error(hash + " != " + expectedHex + " for '" + input + "'");
  258. }
  259. */
  260. };
  261.  
  262. defs["lib/bops/index.js"] = function (module, exports) {
  263. // Repackaged from chrisdickinson/bops MIT licensed.
  264.  
  265. var proto = {}
  266. module.exports = proto
  267.  
  268. proto.from = require('lib/bops/from.js')
  269. proto.to = require('lib/bops/to.js')
  270. proto.is = require('lib/bops/is.js')
  271. proto.subarray = require('lib/bops/subarray.js')
  272. proto.join = require('lib/bops/join.js')
  273. proto.copy = require('lib/bops/copy.js')
  274. proto.create = require('lib/bops/create.js')
  275.  
  276. mix(require('lib/bops/read.js'), proto)
  277. mix(require('lib/bops/write.js'), proto)
  278.  
  279. function mix(from, into) {
  280.   for(var key in from) {
  281.     into[key] = from[key]
  282.   }
  283. }
  284. };
  285.  
  286. defs["lib/bops/from.js"] = function (module, exports) {
  287. module.exports = from
  288.  
  289. var base64 = require('node_modules/base64-js/lib/b64.js')
  290.  
  291. var decoders = {
  292.     hex: from_hex
  293.   , utf8: from_utf
  294.   , base64: from_base64
  295. }
  296.  
  297. function from(source, encoding) {
  298.   if(Array.isArray(source)) {
  299.     return new Uint8Array(source)
  300.   }
  301.  
  302.   return decoders[encoding || 'utf8'](source)
  303. }
  304.  
  305. function from_hex(str) {
  306.   var size = str.length / 2
  307.     , buf = new Uint8Array(size)
  308.     , character = ''
  309.  
  310.   for(var i = 0, len = str.length; i < len; ++i) {
  311.     character += str.charAt(i)
  312.  
  313.     if(i > 0 && (i % 2) === 1) {
  314.       buf[i>>>1] = parseInt(character, 16)
  315.       character = ''
  316.     }
  317.   }
  318.  
  319.   return buf
  320. }
  321.  
  322. function from_utf(str) {
  323.   var bytes = []
  324.     , tmp
  325.     , ch
  326.  
  327.   for(var i = 0, len = str.length; i < len; ++i) {
  328.     ch = str.charCodeAt(i)
  329.     if(ch & 0x80) {
  330.       tmp = encodeURIComponent(str.charAt(i)).substr(1).split('%')
  331.       for(var j = 0, jlen = tmp.length; j < jlen; ++j) {
  332.         bytes[bytes.length] = parseInt(tmp[j], 16)
  333.       }
  334.     } else {
  335.       bytes[bytes.length] = ch
  336.     }
  337.   }
  338.  
  339.   return new Uint8Array(bytes)
  340. }
  341.  
  342. function from_base64(str) {
  343.   return new Uint8Array(base64.toByteArray(str))
  344. }
  345. };
  346.  
  347. defs["node_modules/base64-js/lib/b64.js"] = function (module, exports) {
  348. var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  349.  
  350. ;(function (exports) {
  351.     'use strict';
  352.  
  353.   var Arr = (typeof Uint8Array !== 'undefined')
  354.     ? Uint8Array
  355.     : Array
  356.  
  357.     var ZERO   = '0'.charCodeAt(0)
  358.     var PLUS   = '+'.charCodeAt(0)
  359.     var SLASH  = '/'.charCodeAt(0)
  360.     var NUMBER = '0'.charCodeAt(0)
  361.     var LOWER  = 'a'.charCodeAt(0)
  362.     var UPPER  = 'A'.charCodeAt(0)
  363.  
  364.     function decode (elt) {
  365.         var code = elt.charCodeAt(0)
  366.         if (code === PLUS)
  367.             return 62 // '+'
  368.         if (code === SLASH)
  369.             return 63 // '/'
  370.         if (code < NUMBER)
  371.             return -1 //no match
  372.         if (code < NUMBER + 10)
  373.             return code - NUMBER + 26 + 26
  374.         if (code < UPPER + 26)
  375.             return code - UPPER
  376.         if (code < LOWER + 26)
  377.             return code - LOWER + 26
  378.     }
  379.  
  380.     function b64ToByteArray (b64) {
  381.         var i, j, l, tmp, placeHolders, arr
  382.  
  383.         if (b64.length % 4 > 0) {
  384.             throw new Error('Invalid string. Length must be a multiple of 4')
  385.         }
  386.  
  387.         // the number of equal signs (place holders)
  388.         // if there are two placeholders, than the two characters before it
  389.         // represent one byte
  390.         // if there is only one, then the three characters before it represent 2 bytes
  391.         // this is just a cheap hack to not do indexOf twice
  392.         var len = b64.length
  393.         placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
  394.  
  395.         // base64 is 4/3 + up to two characters of the original data
  396.         arr = new Arr(b64.length * 3 / 4 - placeHolders)
  397.  
  398.         // if there are placeholders, only get up to the last complete 4 chars
  399.         l = placeHolders > 0 ? b64.length - 4 : b64.length
  400.  
  401.         var L = 0
  402.  
  403.         function push (v) {
  404.             arr[L++] = v
  405.         }
  406.  
  407.         for (i = 0, j = 0; i < l; i += 4, j += 3) {
  408.             tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
  409.             push((tmp & 0xFF0000) >> 16)
  410.             push((tmp & 0xFF00) >> 8)
  411.             push(tmp & 0xFF)
  412.         }
  413.  
  414.         if (placeHolders === 2) {
  415.             tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
  416.             push(tmp & 0xFF)
  417.         } else if (placeHolders === 1) {
  418.             tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
  419.             push((tmp >> 8) & 0xFF)
  420.             push(tmp & 0xFF)
  421.         }
  422.  
  423.         return arr
  424.     }
  425.  
  426.     function uint8ToBase64 (uint8) {
  427.         var i,
  428.             extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
  429.             output = "",
  430.             temp, length
  431.  
  432.         function encode (num) {
  433.             return lookup.charAt(num)
  434.         }
  435.  
  436.         function tripletToBase64 (num) {
  437.             return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
  438.         }
  439.  
  440.         // go through the array every three bytes, we'll deal with trailing stuff later
  441.         for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
  442.             temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
  443.             output += tripletToBase64(temp)
  444.         }
  445.  
  446.         // pad the end with zeros, but make sure to not forget the extra bytes
  447.         switch (extraBytes) {
  448.             case 1:
  449.                 temp = uint8[uint8.length - 1]
  450.                 output += encode(temp >> 2)
  451.                 output += encode((temp << 4) & 0x3F)
  452.                 output += '=='
  453.                 break
  454.             case 2:
  455.                 temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
  456.                 output += encode(temp >> 10)
  457.                 output += encode((temp >> 4) & 0x3F)
  458.                 output += encode((temp << 2) & 0x3F)
  459.                 output += '='
  460.                 break
  461.         }
  462.  
  463.         return output
  464.     }
  465.  
  466.     module.exports.toByteArray = b64ToByteArray
  467.     module.exports.fromByteArray = uint8ToBase64
  468. }())
  469. };
  470.  
  471. defs["lib/bops/to.js"] = function (module, exports) {
  472. module.exports = to
  473.  
  474. var base64 = require('node_modules/base64-js/lib/b64.js')
  475.   , toutf8 = require('node_modules/to-utf8/index.js')
  476.  
  477. var encoders = {
  478.     hex: to_hex
  479.   , utf8: to_utf
  480.   , base64: to_base64
  481. }
  482.  
  483. function to(buf, encoding) {
  484.   return encoders[encoding || 'utf8'](buf)
  485. }
  486.  
  487. function to_hex(buf) {
  488.   var str = ''
  489.     , byt
  490.  
  491.   for(var i = 0, len = buf.length; i < len; ++i) {
  492.     byt = buf[i]
  493.     str += ((byt & 0xF0) >>> 4).toString(16)
  494.     str += (byt & 0x0F).toString(16)
  495.   }
  496.  
  497.   return str
  498. }
  499.  
  500. function to_utf(buf) {
  501.   return toutf8(buf)
  502. }
  503.  
  504. function to_base64(buf) {
  505.   return base64.fromByteArray(buf)
  506. }
  507. };
  508.  
  509. defs["node_modules/to-utf8/index.js"] = function (module, exports) {
  510. module.exports = to_utf8
  511.  
  512. var out = []
  513.   , col = []
  514.   , fcc = String.fromCharCode
  515.   , mask = [0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01]
  516.   , unmask = [
  517.       0x00
  518.     , 0x01
  519.     , 0x02 | 0x01
  520.     , 0x04 | 0x02 | 0x01
  521.     , 0x08 | 0x04 | 0x02 | 0x01
  522.     , 0x10 | 0x08 | 0x04 | 0x02 | 0x01
  523.     , 0x20 | 0x10 | 0x08 | 0x04 | 0x02 | 0x01
  524.     , 0x40 | 0x20 | 0x10 | 0x08 | 0x04 | 0x02 | 0x01
  525.   ]
  526.  
  527. function to_utf8(bytes, start, end) {
  528.   start = start === undefined ? 0 : start
  529.   end = end === undefined ? bytes.length : end
  530.  
  531.   var idx = 0
  532.     , hi = 0x80
  533.     , collecting = 0
  534.     , pos
  535.     , by
  536.  
  537.   col.length =
  538.   out.length = 0
  539.  
  540.   while(idx < bytes.length) {
  541.     by = bytes[idx]
  542.     if(!collecting && by & hi) {
  543.       pos = find_pad_position(by)
  544.       collecting += pos
  545.       if(pos < 8) {
  546.         col[col.length] = by & unmask[6 - pos]
  547.       }
  548.     } else if(collecting) {
  549.       col[col.length] = by & unmask[6]
  550.       --collecting
  551.       if(!collecting && col.length) {
  552.         out[out.length] = fcc(reduced(col, pos))
  553.         col.length = 0
  554.       }
  555.     } else {
  556.       out[out.length] = fcc(by)
  557.     }
  558.     ++idx
  559.   }
  560.   if(col.length && !collecting) {
  561.     out[out.length] = fcc(reduced(col, pos))
  562.     col.length = 0
  563.   }
  564.   return out.join('')
  565. }
  566.  
  567. function find_pad_position(byt) {
  568.   for(var i = 0; i < 7; ++i) {
  569.     if(!(byt & mask[i])) {
  570.       break
  571.     }
  572.   }
  573.   return i
  574. }
  575.  
  576. function reduced(list) {
  577.   var out = 0
  578.   for(var i = 0, len = list.length; i < len; ++i) {
  579.     out |= list[i] << ((len - i - 1) * 6)
  580.   }
  581.   return out
  582. }
  583. };
  584.  
  585. defs["lib/bops/is.js"] = function (module, exports) {
  586. module.exports = function(buffer) {
  587.   return buffer instanceof Uint8Array;
  588. }
  589. };
  590.  
  591. defs["lib/bops/subarray.js"] = function (module, exports) {
  592. module.exports = subarray
  593.  
  594. function subarray(buf, from, to) {
  595.   return buf.subarray(from || 0, to || buf.length)
  596. }
  597. };
  598.  
  599. defs["lib/bops/join.js"] = function (module, exports) {
  600. module.exports = join
  601.  
  602. function join(targets, hint) {
  603.   if(!targets.length) {
  604.     return new Uint8Array(0)
  605.   }
  606.  
  607.   var len = hint !== undefined ? hint : get_length(targets)
  608.     , out = new Uint8Array(len)
  609.     , cur = targets[0]
  610.     , curlen = cur.length
  611.     , curidx = 0
  612.     , curoff = 0
  613.     , i = 0
  614.  
  615.   while(i < len) {
  616.     if(curoff === curlen) {
  617.       curoff = 0
  618.       ++curidx
  619.       cur = targets[curidx]
  620.       curlen = cur && cur.length
  621.       continue
  622.     }
  623.     out[i++] = cur[curoff++]
  624.   }
  625.  
  626.   return out
  627. }
  628.  
  629. function get_length(targets) {
  630.   var size = 0
  631.   for(var i = 0, len = targets.length; i < len; ++i) {
  632.     size += targets[i].byteLength
  633.   }
  634.   return size
  635. }
  636. };
  637.  
  638. defs["lib/bops/copy.js"] = function (module, exports) {
  639. module.exports = copy
  640.  
  641. var slice = [].slice
  642.  
  643. function copy(source, target, target_start, source_start, source_end) {
  644.   target_start = arguments.length < 3 ? 0 : target_start
  645.   source_start = arguments.length < 4 ? 0 : source_start
  646.   source_end = arguments.length < 5 ? source.length : source_end
  647.  
  648.   if(source_end === source_start) {
  649.     return
  650.   }
  651.  
  652.   if(target.length === 0 || source.length === 0) {
  653.     return
  654.   }
  655.  
  656.   if(source_end > source.length) {
  657.     source_end = source.length
  658.   }
  659.  
  660.   if(target.length - target_start < source_end - source_start) {
  661.     source_end = target.length - target_start + start
  662.   }
  663.  
  664.   if(source.buffer !== target.buffer) {
  665.     return fast_copy(source, target, target_start, source_start, source_end)
  666.   }
  667.   return slow_copy(source, target, target_start, source_start, source_end)
  668. }
  669.  
  670. function fast_copy(source, target, target_start, source_start, source_end) {
  671.   var len = (source_end - source_start) + target_start
  672.  
  673.   for(var i = target_start, j = source_start;
  674.       i < len;
  675.       ++i,
  676.       ++j) {
  677.     target[i] = source[j]
  678.   }
  679. }
  680.  
  681. function slow_copy(from, to, j, i, jend) {
  682.   // the buffers could overlap.
  683.   var iend = jend + i
  684.     , tmp = new Uint8Array(slice.call(from, i, iend))
  685.     , x = 0
  686.  
  687.   for(; i < iend; ++i, ++x) {
  688.     to[j++] = tmp[x]
  689.   }
  690. }
  691. };
  692.  
  693. defs["lib/bops/create.js"] = function (module, exports) {
  694. module.exports = function(size) {
  695.   return new Uint8Array(size)
  696. }
  697. };
  698.  
  699. defs["lib/bops/read.js"] = function (module, exports) {
  700. module.exports = {
  701.     readUInt8:      read_uint8
  702.   , readInt8:       read_int8
  703.   , readUInt16LE:   read_uint16_le
  704.   , readUInt32LE:   read_uint32_le
  705.   , readInt16LE:    read_int16_le
  706.   , readInt32LE:    read_int32_le
  707.   , readFloatLE:    read_float_le
  708.   , readDoubleLE:   read_double_le
  709.   , readUInt16BE:   read_uint16_be
  710.   , readUInt32BE:   read_uint32_be
  711.   , readInt16BE:    read_int16_be
  712.   , readInt32BE:    read_int32_be
  713.   , readFloatBE:    read_float_be
  714.   , readDoubleBE:   read_double_be
  715. }
  716.  
  717. var map = require('lib/bops/mapped.js')
  718.  
  719. function read_uint8(target, at) {
  720.   return target[at]
  721. }
  722.  
  723. function read_int8(target, at) {
  724.   var v = target[at];
  725.   return v < 0x80 ? v : v - 0x100
  726. }
  727.  
  728. function read_uint16_le(target, at) {
  729.   var dv = map.get(target);
  730.   return dv.getUint16(at + target.byteOffset, true)
  731. }
  732.  
  733. function read_uint32_le(target, at) {
  734.   var dv = map.get(target);
  735.   return dv.getUint32(at + target.byteOffset, true)
  736. }
  737.  
  738. function read_int16_le(target, at) {
  739.   var dv = map.get(target);
  740.   return dv.getInt16(at + target.byteOffset, true)
  741. }
  742.  
  743. function read_int32_le(target, at) {
  744.   var dv = map.get(target);
  745.   return dv.getInt32(at + target.byteOffset, true)
  746. }
  747.  
  748. function read_float_le(target, at) {
  749.   var dv = map.get(target);
  750.   return dv.getFloat32(at + target.byteOffset, true)
  751. }
  752.  
  753. function read_double_le(target, at) {
  754.   var dv = map.get(target);
  755.   return dv.getFloat64(at + target.byteOffset, true)
  756. }
  757.  
  758. function read_uint16_be(target, at) {
  759.   var dv = map.get(target);
  760.   return dv.getUint16(at + target.byteOffset, false)
  761. }
  762.  
  763. function read_uint32_be(target, at) {
  764.   var dv = map.get(target);
  765.   return dv.getUint32(at + target.byteOffset, false)
  766. }
  767.  
  768. function read_int16_be(target, at) {
  769.   var dv = map.get(target);
  770.   return dv.getInt16(at + target.byteOffset, false)
  771. }
  772.  
  773. function read_int32_be(target, at) {
  774.   var dv = map.get(target);
  775.   return dv.getInt32(at + target.byteOffset, false)
  776. }
  777.  
  778. function read_float_be(target, at) {
  779.   var dv = map.get(target);
  780.   return dv.getFloat32(at + target.byteOffset, false)
  781. }
  782.  
  783. function read_double_be(target, at) {
  784.   var dv = map.get(target);
  785.   return dv.getFloat64(at + target.byteOffset, false)
  786. }
  787. };
  788.  
  789. defs["lib/bops/mapped.js"] = function (module, exports) {
  790. var proto
  791.   , map
  792.  
  793. module.exports = proto = {}
  794.  
  795. map = typeof WeakMap === 'undefined' ? null : new WeakMap
  796.  
  797. proto.get = !map ? no_weakmap_get : get
  798.  
  799. function no_weakmap_get(target) {
  800.   return new DataView(target.buffer, 0)
  801. }
  802.  
  803. function get(target) {
  804.   var out = map.get(target.buffer)
  805.   if(!out) {
  806.     map.set(target.buffer, out = new DataView(target.buffer, 0))
  807.   }
  808.   return out
  809. }
  810. };
  811.  
  812. defs["lib/bops/write.js"] = function (module, exports) {
  813. module.exports = {
  814.     writeUInt8:      write_uint8
  815.   , writeInt8:       write_int8
  816.   , writeUInt16LE:   write_uint16_le
  817.   , writeUInt32LE:   write_uint32_le
  818.   , writeInt16LE:    write_int16_le
  819.   , writeInt32LE:    write_int32_le
  820.   , writeFloatLE:    write_float_le
  821.   , writeDoubleLE:   write_double_le
  822.   , writeUInt16BE:   write_uint16_be
  823.   , writeUInt32BE:   write_uint32_be
  824.   , writeInt16BE:    write_int16_be
  825.   , writeInt32BE:    write_int32_be
  826.   , writeFloatBE:    write_float_be
  827.   , writeDoubleBE:   write_double_be
  828. }
  829.  
  830. var map = require('lib/bops/mapped.js')
  831.  
  832. function write_uint8(target, value, at) {
  833.   return target[at] = value
  834. }
  835.  
  836. function write_int8(target, value, at) {
  837.   return target[at] = value < 0 ? value + 0x100 : value
  838. }
  839.  
  840. function write_uint16_le(target, value, at) {
  841.   var dv = map.get(target);
  842.   return dv.setUint16(at + target.byteOffset, value, true)
  843. }
  844.  
  845. function write_uint32_le(target, value, at) {
  846.   var dv = map.get(target);
  847.   return dv.setUint32(at + target.byteOffset, value, true)
  848. }
  849.  
  850. function write_int16_le(target, value, at) {
  851.   var dv = map.get(target);
  852.   return dv.setInt16(at + target.byteOffset, value, true)
  853. }
  854.  
  855. function write_int32_le(target, value, at) {
  856.   var dv = map.get(target);
  857.   return dv.setInt32(at + target.byteOffset, value, true)
  858. }
  859.  
  860. function write_float_le(target, value, at) {
  861.   var dv = map.get(target);
  862.   return dv.setFloat32(at + target.byteOffset, value, true)
  863. }
  864.  
  865. function write_double_le(target, value, at) {
  866.   var dv = map.get(target);
  867.   return dv.setFloat64(at + target.byteOffset, value, true)
  868. }
  869.  
  870. function write_uint16_be(target, value, at) {
  871.   var dv = map.get(target);
  872.   return dv.setUint16(at + target.byteOffset, value, false)
  873. }
  874.  
  875. function write_uint32_be(target, value, at) {
  876.   var dv = map.get(target);
  877.   return dv.setUint32(at + target.byteOffset, value, false)
  878. }
  879.  
  880. function write_int16_be(target, value, at) {
  881.   var dv = map.get(target);
  882.   return dv.setInt16(at + target.byteOffset, value, false)
  883. }
  884.  
  885. function write_int32_be(target, value, at) {
  886.   var dv = map.get(target);
  887.   return dv.setInt32(at + target.byteOffset, value, false)
  888. }
  889.  
  890. function write_float_be(target, value, at) {
  891.   var dv = map.get(target);
  892.   return dv.setFloat32(at + target.byteOffset, value, false)
  893. }
  894.  
  895. function write_double_be(target, value, at) {
  896.   var dv = map.get(target);
  897.   return dv.setFloat64(at + target.byteOffset, value, false)
  898. }
  899. };
  900.  
  901. defs["node_modules/websocket-tcp-client/web-tcp.js"] = function (module, exports) {
  902. exports.connect = connect;
  903. exports.tcp = { connect: connect.bind(null, "tcp") };
  904. exports.tls = { connect: connect.bind(null, "tls") };
  905.  
  906. function connect(protocol, port, host, callback) {
  907.   if (typeof host === "function" && typeof callback === "undefined") {
  908.     callback = host;
  909.     host = "127.0.0.1";
  910.   }
  911.   if (!callback) return connect.bind(this, port, host);
  912.   if (typeof port !== "number") throw new TypeError("port must be number");
  913.   if (typeof host !== "string") throw new TypeError("host must be string");
  914.   if (typeof callback !== "function") throw new TypeError("callback must be function");
  915.   var url = (document.location.protocol + "//" + document.location.host + "/").replace(/^http/, "ws") + protocol + "/" + host + "/" + port;
  916.   var ws = new WebSocket(url, "tcp");
  917.   ws.binaryType = 'arraybuffer';
  918.   ws.onopen = function (evt) {
  919.     ws.onmessage = function (evt) {
  920.       if (evt.data === "connect") return callback(null, wrapSocket(ws));
  921.       callback(new Error(evt.data));
  922.     };
  923.   };
  924. }
  925.  
  926. function wrapSocket(ws) {
  927.   var queue = [];
  928.   var done, cb;
  929.   var source, finish;
  930.  
  931.   ws.onmessage = function (evt) {
  932.     var data = evt.data;
  933.     if (!data) return;
  934.     if (typeof data === "string") {
  935.       queue.push([new Error(data)]);
  936.     }
  937.     else {
  938.       var str = "";
  939.       data = new Uint8Array(data);
  940.       for (var i = 0, l = data.length; i < l; i++) {
  941.         str += String.fromCharCode(data[i]);
  942.       }
  943.       queue.push([null, data]);
  944.     }
  945.     return check();
  946.   };
  947.  
  948.   ws.onclose = function (evt) {
  949.     queue.push([]);
  950.     return check();
  951.   };
  952.  
  953.   ws.onerror = function (evt) {
  954.     queue.push([new Error("Websocket connection closed")]);
  955.     return check();
  956.   };
  957.  
  958.   return { read: read, abort: abort, sink: sink };
  959.  
  960.   function read(callback) {
  961.     if (done) return callback();
  962.     if (cb) return callback(new Error("Only one read at a time allowed"));
  963.     cb = callback;
  964.     return check();
  965.   }
  966.  
  967.   function check() {
  968.     if (cb && queue.length) {
  969.       var callback = cb;
  970.       cb = null;
  971.       callback.apply(null, queue.shift());
  972.     }
  973.   }
  974.  
  975.   function abort(callback) {
  976.     if (done) return callback();
  977.     done = true;
  978.     ws.onmessage = null;
  979.     ws.onclose = null;
  980.     ws.onerror = null;
  981.     try { ws.close(); } catch (err) {}
  982.     callback();
  983.   }
  984.  
  985.   function sink(stream, callback) {
  986.     if (!callback) return sink.bind(this, stream);
  987.     if (source) throw new Error("Already has source");
  988.     source = stream;
  989.     finish = callback;
  990.     source.read(onRead);
  991.   }
  992.  
  993.   function onRead(err, chunk) {
  994.     if (chunk === undefined) {
  995.       try {
  996.         ws.close();
  997.       } catch (err) {}
  998.       return finish(err);
  999.     }
  1000.     ws.send(chunk);
  1001.     source.read(onRead);
  1002.   }
  1003.  
  1004. }
  1005. };
  1006.  
  1007. defs["node_modules/git-http/pure-http.js"] = function (module, exports) {
  1008. var bops, tls, tcp, http, decoder, encoder, trace;
  1009. var pushToPull = require('node_modules/git-http/node_modules/push-to-pull/transform.js');
  1010. var writable = require('node_modules/git-net/writable.js');
  1011. module.exports = function (platform) {
  1012.   bops = platform.bops;
  1013.   tcp = platform.tcp;
  1014.   tls = platform.tls;
  1015.   trace = platform.trace;
  1016.   http = require('node_modules/git-http/node_modules/http-codec/http-codec.js')(platform);
  1017.   decoder = pushToPull(http.client.decoder);
  1018.   encoder = http.client.encoder;
  1019.   return { request: request };
  1020. };
  1021.  
  1022. function request(opts, callback) {
  1023.   if (opts.tls && !tls) return callback(new Error("secure https not supported"));
  1024.   if (!opts.tls && !tcp) return callback(new Error("plain http not supported"));
  1025.  
  1026.   if (trace) trace("request", null, {
  1027.     method: opts.method,
  1028.     host: opts.hostname,
  1029.     port: opts.port,
  1030.     path: opts.path,
  1031.     headers: opts.headers
  1032.   });
  1033.  
  1034.   var read, abort, write;
  1035.  
  1036.   return (opts.tls ? tls : tcp).connect(opts.port, opts.hostname, onConnect);
  1037.  
  1038.   function onConnect(err, socket) {
  1039.     if (err) return callback(err);
  1040.     var input = decoder(socket);
  1041.     read = input.read;
  1042.     abort = input.abort;
  1043.     var output = writable(socket.abort);
  1044.     socket.sink(output, onEnd);
  1045.     write = encoder(output);
  1046.     write({
  1047.       method: opts.method,
  1048.       path: opts.path,
  1049.       headers: objToPairs(opts.headers)
  1050.     });
  1051.     read(onResponse);
  1052.     if (opts.body) {
  1053.       var body = opts.body;
  1054.       if (typeof body === "string") body = bops.from(body);
  1055.       if (bops.is(body)) {
  1056.         return write(body);
  1057.       }
  1058.       throw "TODO: streaming request body";
  1059.     }
  1060.   }
  1061.  
  1062.   function onResponse(err, res) {
  1063.     if (err) return callback(err);
  1064.     var headers = pairsToObj(res.headers);
  1065.  
  1066.     if (trace) trace("response", null, {
  1067.       code: res.code,
  1068.       headers: headers
  1069.     });
  1070.  
  1071.     callback(null, res.code, headers, {read:read,abort:abort});
  1072.  
  1073.   }
  1074.  
  1075.   function onEnd(err) {
  1076.     if (err) throw err;
  1077.   }
  1078.  
  1079. }
  1080.  
  1081. function objToPairs(obj) {
  1082.   return Object.keys(obj).map(function (key) {
  1083.     return [key, obj[key]];
  1084.   });
  1085. }
  1086.  
  1087. function pairsToObj(pairs) {
  1088.   var obj = {};
  1089.   pairs.forEach(function (pair) {
  1090.     obj[pair[0].toLowerCase()] = pair[1];
  1091.   });
  1092.   return obj;
  1093. }
  1094. };
  1095.  
  1096. defs["node_modules/git-http/node_modules/push-to-pull/transform.js"] = function (module, exports) {
  1097. // input push-filter: (emit) -> emit
  1098. // output is simple-stream pull-filter: (stream) -> stream
  1099. module.exports = pushToPull;
  1100. function pushToPull(parser) {
  1101.   return function (stream) {
  1102.  
  1103.     var write = parser(onData);
  1104.     var cb = null;
  1105.     var queue = [];
  1106.      
  1107.     return { read: read, abort: stream.abort };
  1108.    
  1109.     function read(callback) {
  1110.       if (queue.length) return callback(null, queue.shift());
  1111.       if (cb) return callback(new Error("Only one read at a time."));
  1112.       cb = callback;
  1113.       stream.read(onRead);
  1114.      
  1115.     }
  1116.  
  1117.     function onRead(err, item) {
  1118.       var callback = cb;
  1119.       cb = null;
  1120.       if (err) return callback(err);
  1121.       try {
  1122.         write(item);
  1123.       }
  1124.       catch (err) {
  1125.         return callback(err);
  1126.       }
  1127.       return read(callback);
  1128.     }
  1129.  
  1130.     function onData(item) {
  1131.       queue.push(item);
  1132.     }
  1133.  
  1134.   };
  1135. }
  1136. };
  1137.  
  1138. defs["node_modules/git-net/writable.js"] = function (module, exports) {
  1139. module.exports = writable;
  1140.  
  1141. function writable(abort) {
  1142.   var queue = [];
  1143.   var emit = null;
  1144.  
  1145.   write.read = read;
  1146.   write.abort = abort;
  1147.   write.error = error;
  1148.   return write;
  1149.  
  1150.   function write(item) {
  1151.     queue.push([null, item]);
  1152.     check();
  1153.   }
  1154.  
  1155.   function error(err) {
  1156.     queue.push([err]);
  1157.     check();
  1158.   }
  1159.  
  1160.   function read(callback) {
  1161.     if (queue.length) {
  1162.       return callback.apply(null, queue.shift());
  1163.     }
  1164.     if (emit) return callback(new Error("Only one read at a time"));
  1165.     emit = callback;
  1166.     check();
  1167.   }
  1168.  
  1169.   function check() {
  1170.     if (emit && queue.length) {
  1171.       var callback = emit;
  1172.       emit = null;
  1173.       callback.apply(null, queue.shift());
  1174.     }
  1175.   }
  1176. }
  1177. };
  1178.  
  1179. defs["node_modules/git-http/node_modules/http-codec/http-codec.js"] = function (module, exports) {
  1180. var bops, HTTP1_1;
  1181. module.exports = function (platform) {
  1182.   bops = platform.bops;
  1183.   HTTP1_1 = bops.from("HTTP/1.1");
  1184.   return {
  1185.     server: {
  1186.       encoder: serverEncoder,
  1187.       decoder: serverDecoder,
  1188.     },
  1189.     client: {
  1190.       encoder: clientEncoder,
  1191.       decoder: clientDecoder,
  1192.     },
  1193.   };
  1194. };
  1195.  
  1196. function serverEncoder(write) {
  1197.   return function (res) {
  1198.     throw "TODO: Implement serverEncoder";
  1199.   };
  1200. }
  1201.  
  1202. function clientEncoder(write) {
  1203.   return function (req) {
  1204.     if (req === undefined) return write(undefined);
  1205.     if (bops.is(req)) return write(req);
  1206.     var head = req.method + " " + req.path + " HTTP/1.1\r\n";
  1207.     req.headers.forEach(function (pair) {
  1208.       head += pair[0] + ": " + pair[1] + "\r\n";
  1209.     });
  1210.     head += "\r\n";
  1211.     write(bops.from(head));
  1212.   };
  1213. }
  1214.  
  1215. function clientDecoder(emit) {
  1216.   return parser(true, emit);
  1217. }
  1218.  
  1219. function serverDecoder(emit) {
  1220.   return parser(false, emit);
  1221. }
  1222.  
  1223. function parser(client, emit) {
  1224.   var position = 0, code = 0;
  1225.   var key = "", value = "";
  1226.   var chunked = false, length;
  1227.   var headers = [];
  1228.   var $start = client ? $client : $server;
  1229.   var state = $start;
  1230.   return function (chunk) {
  1231.     if (chunk === undefined) return emit();
  1232.     if (!state) return emit(chunk);
  1233.     var i = 0, length = chunk.length;
  1234.     while (i < length) {
  1235.       state = state(chunk[i++]);
  1236.       if (state) continue;
  1237.       emit(bops.subarray(chunk, i));
  1238.       break;
  1239.     }
  1240.   };
  1241.  
  1242.   function $client(byte) {
  1243.     if (byte === HTTP1_1[position++]) return $client;
  1244.     if (byte === 0x20 && position === 9) {
  1245.       position = 0;
  1246.       return $code;
  1247.     }
  1248.     throw new SyntaxError("Must be HTTP/1.1 response");
  1249.   }
  1250.  
  1251.   function $code(byte) {
  1252.     if (byte === 0x20) return $message;
  1253.     if (position++ < 3) {
  1254.       code = (code * 10) + byte - 0x30;
  1255.       position = 0;
  1256.       return $code;
  1257.     }
  1258.     throw new SyntaxError("Invalid status code");
  1259.   }
  1260.  
  1261.   function $message(byte) {
  1262.     if (byte === 0x0d) {
  1263.       position = 0;
  1264.       return $newline;
  1265.     }
  1266.     return $message;
  1267.   }
  1268.  
  1269.   function $server(byte) {
  1270.     throw "TODO: Implement server-side parser";
  1271.   }
  1272.  
  1273.   function $newline(byte) {
  1274.     if (byte === 0x0a) return $end;
  1275.     throw new SyntaxError("Invalid line ending");
  1276.   }
  1277.  
  1278.   function $end(byte) {
  1279.     if (byte === 0x0d) return $ending;
  1280.     return $key(byte);
  1281.   }
  1282.  
  1283.   function $key(byte) {
  1284.     if (byte === 0x3a) return $sep;
  1285.     key += String.fromCharCode(byte);
  1286.     return $key;
  1287.   }
  1288.  
  1289.   function $sep(byte) {
  1290.     if (byte === 0x20) return $sep;
  1291.     return $value(byte);
  1292.   }
  1293.  
  1294.   function $value(byte) {
  1295.     if (byte === 0x0d) {
  1296.       var lower = key.toLowerCase();
  1297.       if (lower === "transfer-encoding" && value === "chunked") {
  1298.         chunked = true;
  1299.       }
  1300.       else if (lower === "content-length") length = parseInt(value, 10);
  1301.       headers.push([key, value]);
  1302.       key = "";
  1303.       value = "";
  1304.       return $newline;
  1305.     }
  1306.     value += String.fromCharCode(byte);
  1307.     return $value;
  1308.   }
  1309.  
  1310.   function $ending(byte) {
  1311.     if (byte === 0x0a) {
  1312.       emit({
  1313.         code: code,
  1314.         headers: headers
  1315.       });
  1316.       headers = [];
  1317.       code = 0;
  1318.       if (chunked) return chunkMachine(emit, $start);
  1319.       return null;
  1320.     }
  1321.     throw new SyntaxError("Invalid header ending");
  1322.   }
  1323.  
  1324. }
  1325.  
  1326. function chunkMachine(emit, $start) {
  1327.   var position = 0, size = 0;
  1328.   var chunk = null;
  1329.   return $len;
  1330.   function $len(byte) {
  1331.     if (byte === 0x0d) return $chunkStart;
  1332.     size <<= 4;
  1333.     if (byte >= 0x30 && byte < 0x40) size += byte - 0x30;
  1334.     else if (byte > 0x60 && byte <= 0x66) size += byte - 0x57;
  1335.     else if (byte > 0x40 && byte <= 0x46) size += byte - 0x37;
  1336.     else throw new SyntaxError("Invalid chunked encoding length header");
  1337.     return $len;
  1338.   }
  1339.  
  1340.   function $chunkStart(byte) {
  1341.     if (byte === 0x0a) {
  1342.       if (size) {
  1343.         chunk = bops.create(size);
  1344.         return $chunk;
  1345.       }
  1346.       return $ending;
  1347.     }
  1348.     throw new SyntaxError("Invalid chunk ending");
  1349.   }
  1350.  
  1351.   function $chunk(byte) {
  1352.     chunk[position++] = byte;
  1353.     if (position < size) return $chunk;
  1354.     return $ending;
  1355.   }
  1356.  
  1357.   function $ending(byte) {
  1358.     if (byte !== 0x0d) throw new SyntaxError("Problem in chunked encoding");
  1359.     return $end;
  1360.  
  1361.   }
  1362.  
  1363.   function $end(byte) {
  1364.     if (byte !== 0x0a) throw new SyntaxError("Problem in chunked encoding");
  1365.     var next;
  1366.     if (size) {
  1367.       emit(chunk);
  1368.       next = $len;
  1369.     }
  1370.     else {
  1371.       emit();
  1372.       next = $start;
  1373.     }
  1374.     chunk = null;
  1375.     size = 0;
  1376.     position = 0;
  1377.     return next;
  1378.   }
  1379.  
  1380. }
  1381.  
  1382.  
  1383. // exports.encoder = encoder;
  1384. // function encoder(emit) {
  1385. //   var fn = function (err, item) {
  1386. //     if (item === undefined) return emit(err);
  1387. //     if (typeof item === "string") {
  1388. //       return emit(null, bops.from(item));
  1389. //     }
  1390. //     if (bops.is(item)) {
  1391. //       return emit(null, item);
  1392. //     }
  1393. //     var head = "HTTP/1.1 " + item.statusCode + " " + STATUS_CODES[item.statusCode] + "\r\n";
  1394. //     for (var i = 0, l = item.headers.length; i < l; i += 2) {
  1395. //       head += item.headers[i] + ": " + item.headers[i + 1] + "\r\n";
  1396. //     }
  1397. //     head += "\r\n";
  1398. //     emit(null, bops.from(head));
  1399. //   };
  1400. //   fn.is = "min-stream-write";
  1401. //   return fn;
  1402. // }
  1403. // encoder.is = "min-stream-push-filter";
  1404. // function syntaxError(message, array) {
  1405. //   return new SyntaxError(message + ": " +
  1406. //     JSON.stringify(bops.to(bops.from(array)))
  1407. //   );
  1408. // }
  1409.  
  1410. var STATUS_CODES = {
  1411.   '100': 'Continue',
  1412.   '101': 'Switching Protocols',
  1413.   '102': 'Processing',                 // RFC 2518, obsoleted by RFC 4918
  1414.   '200': 'OK',
  1415.   '201': 'Created',
  1416.   '202': 'Accepted',
  1417.   '203': 'Non-Authoritative Information',
  1418.   '204': 'No Content',
  1419.   '205': 'Reset Content',
  1420.   '206': 'Partial Content',
  1421.   '207': 'Multi-Status',               // RFC 4918
  1422.   '300': 'Multiple Choices',
  1423.   '301': 'Moved Permanently',
  1424.   '302': 'Moved Temporarily',
  1425.   '303': 'See Other',
  1426.   '304': 'Not Modified',
  1427.   '305': 'Use Proxy',
  1428.   '307': 'Temporary Redirect',
  1429.   '400': 'Bad Request',
  1430.   '401': 'Unauthorized',
  1431.   '402': 'Payment Required',
  1432.   '403': 'Forbidden',
  1433.   '404': 'Not Found',
  1434.   '405': 'Method Not Allowed',
  1435.   '406': 'Not Acceptable',
  1436.   '407': 'Proxy Authentication Required',
  1437.   '408': 'Request Time-out',
  1438.   '409': 'Conflict',
  1439.   '410': 'Gone',
  1440.   '411': 'Length Required',
  1441.   '412': 'Precondition Failed',
  1442.   '413': 'Request Entity Too Large',
  1443.   '414': 'Request-URI Too Large',
  1444.   '415': 'Unsupported Media Type',
  1445.   '416': 'Requested Range Not Satisfiable',
  1446.   '417': 'Expectation Failed',
  1447.   '418': 'I\'m a teapot',              // RFC 2324
  1448.   '422': 'Unprocessable Entity',       // RFC 4918
  1449.   '423': 'Locked',                     // RFC 4918
  1450.   '424': 'Failed Dependency',          // RFC 4918
  1451.   '425': 'Unordered Collection',       // RFC 4918
  1452.   '426': 'Upgrade Required',           // RFC 2817
  1453.   '500': 'Internal Server Error',
  1454.   '501': 'Not Implemented',
  1455.   '502': 'Bad Gateway',
  1456.   '503': 'Service Unavailable',
  1457.   '504': 'Gateway Time-out',
  1458.   '505': 'HTTP Version not supported',
  1459.   '506': 'Variant Also Negotiates',    // RFC 2295
  1460.   '507': 'Insufficient Storage',       // RFC 4918
  1461.   '509': 'Bandwidth Limit Exceeded',
  1462.   '510': 'Not Extended'                // RFC 2774
  1463. };
  1464. };
  1465.  
  1466. defs["node_modules/js-git/js-git.js"] = function (module, exports) {
  1467. module.exports = newRepo;
  1468.  
  1469. function newRepo(db) {
  1470.   if (!db) throw new TypeError("A db interface instance is required");
  1471.  
  1472.   // Create a new repo object.
  1473.   var repo = {};
  1474.  
  1475.   // Auto trace the db if tracing is turned on.
  1476.   if (require('node_modules/js-git/lib/trace.js')) db = require('node_modules/js-git/lib/tracedb.js')(db);
  1477.  
  1478.   // Add the db interface (used by objects, refs, and packops mixins)
  1479.   repo.db = db;
  1480.  
  1481.   // Mix in object store interface
  1482.   require('node_modules/js-git/mixins/objects.js')(repo);
  1483.  
  1484.   // Mix in the references interface
  1485.   require('node_modules/js-git/mixins/refs.js')(repo);
  1486.  
  1487.   // Mix in the walker helpers
  1488.   require('node_modules/js-git/mixins/walkers.js')(repo);
  1489.  
  1490.   // Mix in packfile import and export ability
  1491.   require('node_modules/js-git/mixins/packops.js')(repo);
  1492.  
  1493.   // Mix in git network client ability
  1494.   require('node_modules/js-git/mixins/client.js')(repo);
  1495.  
  1496.   // Mix in git network client ability
  1497.   require('node_modules/js-git/mixins/server.js')(repo);
  1498.  
  1499.   return repo;
  1500. }
  1501. };
  1502.  
  1503. defs["node_modules/js-git/lib/trace.js"] = function (module, exports) {
  1504. module.exports = false;
  1505. };
  1506.  
  1507. defs["node_modules/js-git/lib/tracedb.js"] = function (module, exports) {
  1508. var trace = require('node_modules/js-git/lib/trace.js');
  1509.  
  1510. module.exports = function (db) {
  1511.   return {
  1512.     get: wrap1("get", db.get),
  1513.     set: wrap2("set", db.set),
  1514.     has: wrap1("has", db.has),
  1515.     del: wrap1("del", db.del),
  1516.     keys: wrap1("keys", db.keys),
  1517.     init: wrap0("init", db.init),
  1518.   };
  1519. };
  1520.  
  1521. function wrap0(type, fn) {
  1522.   return zero;
  1523.   function zero(callback) {
  1524.     if (!callback) return zero.bind(this);
  1525.     return fn.call(this, check);
  1526.     function check(err) {
  1527.       if (err) return callback(err);
  1528.       trace(type, null);
  1529.       return callback.apply(this, arguments);
  1530.     }
  1531.   }
  1532. }
  1533.  
  1534. function wrap1(type, fn) {
  1535.   return one;
  1536.   function one(arg, callback) {
  1537.     if (!callback) return one.bind(this, arg);
  1538.     return fn.call(this, arg, check);
  1539.     function check(err) {
  1540.       if (err) return callback(err);
  1541.       trace(type, null, arg);
  1542.       return callback.apply(this, arguments);
  1543.     }
  1544.   }
  1545. }
  1546.  
  1547. function wrap2(type, fn) {
  1548.   return two;
  1549.   function two(arg1, arg2, callback) {
  1550.     if (!callback) return two.bind(this, arg1. arg2);
  1551.     return fn.call(this, arg1, arg2, check);
  1552.     function check(err) {
  1553.       if (err) return callback(err);
  1554.       trace(type, null, arg1);
  1555.       return callback.apply(this, arguments);
  1556.     }
  1557.   }
  1558. }
  1559. };
  1560.  
  1561. defs["node_modules/js-git/mixins/objects.js"] = function (module, exports) {
  1562. var sha1 = require('node_modules/js-git/lib/sha1.js');
  1563. var frame = require('node_modules/js-git/lib/frame.js');
  1564. var deframe = require('node_modules/js-git/lib/deframe.js');
  1565. var encoders = require('node_modules/js-git/lib/encoders.js');
  1566. var decoders = require('node_modules/js-git/lib/decoders.js');
  1567. var parseAscii = require('node_modules/js-git/lib/parseascii.js');
  1568. var isHash = require('node_modules/js-git/lib/ishash.js');
  1569.  
  1570. // Add "objects" capabilities to a repo using db as storage.
  1571. module.exports = function (repo) {
  1572.  
  1573.   // Add Object store capability to the system
  1574.   repo.load = load;       // (hash-ish) -> object
  1575.   repo.save = save;       // (object) -> hash
  1576.   repo.loadRaw = loadRaw; // (hash) -> buffer
  1577.   repo.saveRaw = saveRaw; // (hash, buffer)
  1578.   repo.has = has;         // (hash) -> true or false
  1579.   repo.loadAs = loadAs;   // (type, hash-ish) -> value
  1580.   repo.saveAs = saveAs;   // (type, value) -> hash
  1581.   repo.remove = remove;   // (hash)
  1582.  
  1583.   // This is a fallback resolve in case there is no refs system installed.
  1584.   if (!repo.resolve) repo.resolve = function (hash, callback) {
  1585.     if (isHash(hash)) return callback(null, hash);
  1586.     return callback(new Error("This repo only supports direct hashes"));
  1587.   };
  1588.  
  1589. };
  1590.  
  1591. function load(hashish, callback) {
  1592.   if (!callback) return load.bind(this, hashish);
  1593.   var hash;
  1594.   var repo = this;
  1595.   var db = repo.db;
  1596.   return repo.resolve(hashish, onHash);
  1597.  
  1598.   function onHash(err, result) {
  1599.     if (result === undefined) return callback(err);
  1600.     hash = result;
  1601.     return db.get(hash, onBuffer);
  1602.   }
  1603.  
  1604.   function onBuffer(err, buffer) {
  1605.     if (buffer === undefined) return callback(err);
  1606.     var type, object;
  1607.     try {
  1608.       if (sha1(buffer) !== hash) {
  1609.         throw new Error("Hash checksum failed for " + hash);
  1610.       }
  1611.       var pair = deframe(buffer);
  1612.       type = pair[0];
  1613.       buffer = pair[1];
  1614.       object = {
  1615.         type: type,
  1616.         body: decoders[type](buffer)
  1617.       };
  1618.     } catch (err) {
  1619.       if (err) return callback(err);
  1620.     }
  1621.     return callback(null, object, hash);
  1622.   }
  1623. }
  1624.  
  1625. function loadRaw(hash, callback) {
  1626.   return this.db.get(hash, callback);
  1627. }
  1628.  
  1629. function saveRaw(hash, buffer, callback) {
  1630.   return this.db.set(hash, buffer, callback);
  1631. }
  1632.  
  1633. function has(hash, callback) {
  1634.   return this.db.has(hash, callback);
  1635. }
  1636.  
  1637. function save(object, callback) {
  1638.   if (!callback) return save.bind(this, object);
  1639.   var buffer, hash;
  1640.   var repo = this;
  1641.   var db = repo.db;
  1642.   try {
  1643.     buffer = encoders[object.type](object.body);
  1644.     buffer = frame(object.type, buffer);
  1645.     hash = sha1(buffer);
  1646.   }
  1647.   catch (err) {
  1648.     return callback(err);
  1649.   }
  1650.   return db.set(hash, buffer, onSave);
  1651.  
  1652.   function onSave(err) {
  1653.     if (err) return callback(err);
  1654.     return callback(null, hash);
  1655.   }
  1656. }
  1657.  
  1658. function remove(hash, callback) {
  1659.   if (!callback) return remove.bind(this, hash);
  1660.   if (!isHash(hash)) return callback(new Error("Invalid hash: " + hash));
  1661.   var repo = this;
  1662.   var db = repo.db;
  1663.   return db.del(hash, callback);
  1664. }
  1665.  
  1666. function loadAs(type, hashish, callback) {
  1667.   if (!callback) return loadAs.bind(this, type, hashish);
  1668.   return this.load(hashish, onObject);
  1669.  
  1670.   function onObject(err, object, hash) {
  1671.     if (object === undefined) return callback(err);
  1672.     if (type === "text") {
  1673.       type = "blob";
  1674.       object.body = parseAscii(object.body, 0, object.body.length);
  1675.     }
  1676.     if (object.type !== type) {
  1677.       return new Error("Expected " + type + ", but found " + object.type);
  1678.     }
  1679.     return callback(null, object.body, hash);
  1680.   }
  1681. }
  1682.  
  1683. function saveAs(type, body, callback) {
  1684.   if (!callback) return saveAs.bind(this, type, body);
  1685.   if (type === "text") type = "blob";
  1686.   return this.save({ type: type, body: body }, callback);
  1687. }
  1688. };
  1689.  
  1690. defs["node_modules/js-git/lib/sha1.js"] = function (module, exports) {
  1691. var Array32 = typeof Uint32Array === "function" ? Uint32Array : Array;
  1692.  
  1693. module.exports = function sha1(buffer) {
  1694.   if (buffer === undefined) return create();
  1695.   var shasum = create();
  1696.   shasum.update(buffer);
  1697.   return shasum.digest();
  1698. };
  1699.  
  1700. // A streaming interface for when nothing is passed in.
  1701. function create() {
  1702.   var h0 = 0x67452301;
  1703.   var h1 = 0xEFCDAB89;
  1704.   var h2 = 0x98BADCFE;
  1705.   var h3 = 0x10325476;
  1706.   var h4 = 0xC3D2E1F0;
  1707.   // The first 64 bytes (16 words) is the data chunk
  1708.   var block = new Array32(80), offset = 0, shift = 24;
  1709.   var totalLength = 0;
  1710.  
  1711.   return { update: update, digest: digest };
  1712.  
  1713.   // The user gave us more data.  Store it!
  1714.   function update(chunk) {
  1715.     if (typeof chunk === "string") return updateString(chunk);
  1716.     var length = chunk.length;
  1717.     totalLength += length * 8;
  1718.     for (var i = 0; i < length; i++) {
  1719.       write(chunk[i]);
  1720.     }
  1721.   }
  1722.  
  1723.   function updateString(string) {
  1724.     var length = string.length;
  1725.     totalLength += length * 8;
  1726.     for (var i = 0; i < length; i++) {
  1727.       write(string.charCodeAt(i));
  1728.     }
  1729.   }
  1730.  
  1731.   function write(byte) {
  1732.     block[offset] |= (byte & 0xff) << shift;
  1733.     if (shift) {
  1734.       shift -= 8;
  1735.     }
  1736.     else {
  1737.       offset++;
  1738.       shift = 24;
  1739.     }
  1740.     if (offset === 16) processBlock();
  1741.   }
  1742.  
  1743.   // No more data will come, pad the block, process and return the result.
  1744.   function digest() {
  1745.     // Pad
  1746.     write(0x80);
  1747.     if (offset > 14 || (offset === 14 && shift < 24)) {
  1748.       processBlock();
  1749.     }
  1750.     offset = 14;
  1751.     shift = 24;
  1752.  
  1753.     // 64-bit length big-endian
  1754.     write(0x00); // numbers this big aren't accurate in javascript anyway
  1755.     write(0x00); // ..So just hard-code to zero.
  1756.     write(totalLength > 0xffffffffff ? totalLength / 0x10000000000 : 0x00);
  1757.     write(totalLength > 0xffffffff ? totalLength / 0x100000000 : 0x00);
  1758.     for (var s = 24; s >= 0; s -= 8) {
  1759.       write(totalLength >> s);
  1760.     }
  1761.  
  1762.     // At this point one last processBlock() should trigger and we can pull out the result.
  1763.     return toHex(h0)
  1764.          + toHex(h1)
  1765.          + toHex(h2)
  1766.          + toHex(h3)
  1767.          + toHex(h4);
  1768.   }
  1769.  
  1770.   // We have a full block to process.  Let's do it!
  1771.   function processBlock() {
  1772.     // Extend the sixteen 32-bit words into eighty 32-bit words:
  1773.     for (var i = 16; i < 80; i++) {
  1774.       var w = block[i - 3] ^ block[i - 8] ^ block[i - 14] ^ block[i - 16];
  1775.       block[i] = (w << 1) | (w >>> 31);
  1776.     }
  1777.  
  1778.     // log(block);
  1779.  
  1780.     // Initialize hash value for this chunk:
  1781.     var a = h0;
  1782.     var b = h1;
  1783.     var c = h2;
  1784.     var d = h3;
  1785.     var e = h4;
  1786.     var f, k;
  1787.  
  1788.     // Main loop:
  1789.     for (i = 0; i < 80; i++) {
  1790.       if (i < 20) {
  1791.         f = d ^ (b & (c ^ d));
  1792.         k = 0x5A827999;
  1793.       }
  1794.       else if (i < 40) {
  1795.         f = b ^ c ^ d;
  1796.         k = 0x6ED9EBA1;
  1797.       }
  1798.       else if (i < 60) {
  1799.         f = (b & c) | (d & (b | c));
  1800.         k = 0x8F1BBCDC;
  1801.       }
  1802.       else {
  1803.         f = b ^ c ^ d;
  1804.         k = 0xCA62C1D6;
  1805.       }
  1806.       var temp = (a << 5 | a >>> 27) + f + e + k + (block[i]|0);
  1807.       e = d;
  1808.       d = c;
  1809.       c = (b << 30 | b >>> 2);
  1810.       b = a;
  1811.       a = temp;
  1812.     }
  1813.  
  1814.     // Add this chunk's hash to result so far:
  1815.     h0 = (h0 + a) | 0;
  1816.     h1 = (h1 + b) | 0;
  1817.     h2 = (h2 + c) | 0;
  1818.     h3 = (h3 + d) | 0;
  1819.     h4 = (h4 + e) | 0;
  1820.  
  1821.     // The block is now reusable.
  1822.     offset = 0;
  1823.     for (i = 0; i < 16; i++) {
  1824.       block[i] = 0;
  1825.     }
  1826.   }
  1827.  
  1828.   function toHex(word) {
  1829.     var hex = "";
  1830.     for (var i = 28; i >= 0; i -= 4) {
  1831.       hex += ((word >> i) & 0xf).toString(16);
  1832.     }
  1833.     return hex;
  1834.   }
  1835.  
  1836. }
  1837. };
  1838.  
  1839. defs["node_modules/js-git/lib/frame.js"] = function (module, exports) {
  1840. var bops =  require('node_modules/js-git/node_modules/bops/index.js');
  1841.  
  1842. module.exports = function frame(type, body) {
  1843.   return bops.join([
  1844.     bops.from(type + " " + body.length + "\0"),
  1845.     body
  1846.   ]);
  1847. };
  1848. };
  1849.  
  1850. defs["node_modules/js-git/node_modules/bops/index.js"] = function (module, exports) {
  1851. var proto = {}
  1852. module.exports = proto
  1853.  
  1854. proto.from = require('node_modules/js-git/node_modules/bops/typedarray/from.js')
  1855. proto.to = require('node_modules/js-git/node_modules/bops/typedarray/to.js')
  1856. proto.is = require('node_modules/js-git/node_modules/bops/typedarray/is.js')
  1857. proto.subarray = require('node_modules/js-git/node_modules/bops/typedarray/subarray.js')
  1858. proto.join = require('node_modules/js-git/node_modules/bops/typedarray/join.js')
  1859. proto.copy = require('node_modules/js-git/node_modules/bops/typedarray/copy.js')
  1860. proto.create = require('node_modules/js-git/node_modules/bops/typedarray/create.js')
  1861.  
  1862. mix(require('node_modules/js-git/node_modules/bops/typedarray/read.js'), proto)
  1863. mix(require('node_modules/js-git/node_modules/bops/typedarray/write.js'), proto)
  1864.  
  1865. function mix(from, into) {
  1866.   for(var key in from) {
  1867.     into[key] = from[key]
  1868.   }
  1869. }
  1870. };
  1871.  
  1872. defs["node_modules/js-git/node_modules/bops/typedarray/from.js"] = function (module, exports) {
  1873. module.exports = from
  1874.  
  1875. var base64 = require('node_modules/js-git/node_modules/bops/node_modules/base64-js/lib/b64.js')
  1876.  
  1877. var decoders = {
  1878.     hex: from_hex
  1879.   , utf8: from_utf
  1880.   , base64: from_base64
  1881. }
  1882.  
  1883. function from(source, encoding) {
  1884.   if(Array.isArray(source)) {
  1885.     return new Uint8Array(source)
  1886.   }
  1887.  
  1888.   return decoders[encoding || 'utf8'](source)
  1889. }
  1890.  
  1891. function from_hex(str) {
  1892.   var size = str.length / 2
  1893.     , buf = new Uint8Array(size)
  1894.     , character = ''
  1895.  
  1896.   for(var i = 0, len = str.length; i < len; ++i) {
  1897.     character += str.charAt(i)
  1898.  
  1899.     if(i > 0 && (i % 2) === 1) {
  1900.       buf[i>>>1] = parseInt(character, 16)
  1901.       character = ''
  1902.     }
  1903.   }
  1904.  
  1905.   return buf
  1906. }
  1907.  
  1908. function from_utf(str) {
  1909.   var arr = []
  1910.     , code
  1911.  
  1912.   for(var i = 0, len = str.length; i < len; ++i) {
  1913.     code = fixed_cca(str, i)
  1914.  
  1915.     if(code === false) {
  1916.       continue
  1917.     }
  1918.  
  1919.     if(code < 0x80) {
  1920.       arr[arr.length] = code
  1921.  
  1922.       continue
  1923.     }
  1924.  
  1925.     codepoint_to_bytes(arr, code)
  1926.   }
  1927.  
  1928.   return new Uint8Array(arr)
  1929. }
  1930.  
  1931. function codepoint_to_bytes(arr, code) {
  1932.   // find MSB, use that to determine byte count
  1933.   var copy_code = code
  1934.     , bit_count = 0
  1935.     , byte_count
  1936.     , prefix
  1937.     , _byte
  1938.     , pos
  1939.  
  1940.   do {
  1941.     ++bit_count
  1942.   } while(copy_code >>>= 1)
  1943.  
  1944.   byte_count = Math.ceil((bit_count - 1) / 5) | 0
  1945.   prefix = [0, 0, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc][byte_count]
  1946.   pos = [0, 0, 3, 4, 5, 6, 7][byte_count]
  1947.  
  1948.   _byte |= prefix
  1949.  
  1950.   bit_count = (7 - pos) + 6 * (byte_count - 1)
  1951.  
  1952.   while(bit_count) {
  1953.     _byte |= +!!(code & (1 << bit_count)) << (7 - pos)
  1954.     ++pos
  1955.  
  1956.     if(pos % 8 === 0) {
  1957.       arr[arr.length] = _byte
  1958.       _byte = 0x80
  1959.       pos = 2
  1960.     }
  1961.  
  1962.     --bit_count
  1963.   }
  1964.  
  1965.   if(pos) {
  1966.     _byte |= +!!(code & 1) << (7 - pos)
  1967.     arr[arr.length] = _byte
  1968.   }
  1969. }
  1970.  
  1971. function pad(str) {
  1972.   while(str.length < 8) {
  1973.     str = '0' + str
  1974.   }
  1975.  
  1976.   return str
  1977. }
  1978.  
  1979. function fixed_cca(str, idx) {
  1980.   idx = idx || 0
  1981.  
  1982.   var code = str.charCodeAt(idx)
  1983.     , lo
  1984.     , hi
  1985.  
  1986.   if(0xD800 <= code && code <= 0xDBFF) {
  1987.     lo = str.charCodeAt(idx + 1)
  1988.     hi = code
  1989.  
  1990.     if(isNaN(lo)) {
  1991.       throw new Error('High surrogate not followed by low surrogate')
  1992.     }
  1993.  
  1994.     return ((hi - 0xD800) * 0x400) + (lo - 0xDC00) + 0x10000
  1995.   }
  1996.  
  1997.   if(0xDC00 <= code && code <= 0xDFFF) {
  1998.     return false
  1999.   }
  2000.  
  2001.   return code
  2002. }
  2003.  
  2004. function from_base64(str) {
  2005.   return new Uint8Array(base64.toByteArray(str))
  2006. }
  2007. };
  2008.  
  2009. defs["node_modules/js-git/node_modules/bops/node_modules/base64-js/lib/b64.js"] = function (module, exports) {
  2010. (function (exports) {
  2011.     'use strict';
  2012.  
  2013.     var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  2014.  
  2015.     function b64ToByteArray(b64) {
  2016.         var i, j, l, tmp, placeHolders, arr;
  2017.    
  2018.         if (b64.length % 4 > 0) {
  2019.             throw 'Invalid string. Length must be a multiple of 4';
  2020.         }
  2021.  
  2022.         // the number of equal signs (place holders)
  2023.         // if there are two placeholders, than the two characters before it
  2024.         // represent one byte
  2025.         // if there is only one, then the three characters before it represent 2 bytes
  2026.         // this is just a cheap hack to not do indexOf twice
  2027.         placeHolders = b64.indexOf('=');
  2028.         placeHolders = placeHolders > 0 ? b64.length - placeHolders : 0;
  2029.  
  2030.         // base64 is 4/3 + up to two characters of the original data
  2031.         arr = [];//new Uint8Array(b64.length * 3 / 4 - placeHolders);
  2032.  
  2033.         // if there are placeholders, only get up to the last complete 4 chars
  2034.         l = placeHolders > 0 ? b64.length - 4 : b64.length;
  2035.  
  2036.         for (i = 0, j = 0; i < l; i += 4, j += 3) {
  2037.             tmp = (lookup.indexOf(b64[i]) << 18) | (lookup.indexOf(b64[i + 1]) << 12) | (lookup.indexOf(b64[i + 2]) << 6) | lookup.indexOf(b64[i + 3]);
  2038.             arr.push((tmp & 0xFF0000) >> 16);
  2039.             arr.push((tmp & 0xFF00) >> 8);
  2040.             arr.push(tmp & 0xFF);
  2041.         }
  2042.  
  2043.         if (placeHolders === 2) {
  2044.             tmp = (lookup.indexOf(b64[i]) << 2) | (lookup.indexOf(b64[i + 1]) >> 4);
  2045.             arr.push(tmp & 0xFF);
  2046.         } else if (placeHolders === 1) {
  2047.             tmp = (lookup.indexOf(b64[i]) << 10) | (lookup.indexOf(b64[i + 1]) << 4) | (lookup.indexOf(b64[i + 2]) >> 2);
  2048.             arr.push((tmp >> 8) & 0xFF);
  2049.             arr.push(tmp & 0xFF);
  2050.         }
  2051.  
  2052.         return arr;
  2053.     }
  2054.  
  2055.     function uint8ToBase64(uint8) {
  2056.         var i,
  2057.             extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
  2058.             output = "",
  2059.             temp, length;
  2060.  
  2061.         function tripletToBase64 (num) {
  2062.             return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
  2063.         };
  2064.  
  2065.         // go through the array every three bytes, we'll deal with trailing stuff later
  2066.         for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
  2067.             temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]);
  2068.             output += tripletToBase64(temp);
  2069.         }
  2070.  
  2071.         // pad the end with zeros, but make sure to not forget the extra bytes
  2072.         switch (extraBytes) {
  2073.             case 1:
  2074.                 temp = uint8[uint8.length - 1];
  2075.                 output += lookup[temp >> 2];
  2076.                 output += lookup[(temp << 4) & 0x3F];
  2077.                 output += '==';
  2078.                 break;
  2079.             case 2:
  2080.                 temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]);
  2081.                 output += lookup[temp >> 10];
  2082.                 output += lookup[(temp >> 4) & 0x3F];
  2083.                 output += lookup[(temp << 2) & 0x3F];
  2084.                 output += '=';
  2085.                 break;
  2086.         }
  2087.  
  2088.         return output;
  2089.     }
  2090.  
  2091.     module.exports.toByteArray = b64ToByteArray;
  2092.     module.exports.fromByteArray = uint8ToBase64;
  2093. }());
  2094. };
  2095.  
  2096. defs["node_modules/js-git/node_modules/bops/typedarray/to.js"] = function (module, exports) {
  2097. module.exports = to
  2098.  
  2099. var base64 = require('node_modules/js-git/node_modules/bops/node_modules/base64-js/lib/b64.js')
  2100.   , toutf8 = require('node_modules/to-utf8/index.js')
  2101.  
  2102. var encoders = {
  2103.     hex: to_hex
  2104.   , utf8: to_utf
  2105.   , base64: to_base64
  2106. }
  2107.  
  2108. function to(buf, encoding) {
  2109.   return encoders[encoding || 'utf8'](buf)
  2110. }
  2111.  
  2112. function to_hex(buf) {
  2113.   var str = ''
  2114.     , byt
  2115.  
  2116.   for(var i = 0, len = buf.length; i < len; ++i) {
  2117.     byt = buf[i]
  2118.     str += ((byt & 0xF0) >>> 4).toString(16)
  2119.     str += (byt & 0x0F).toString(16)
  2120.   }
  2121.  
  2122.   return str
  2123. }
  2124.  
  2125. function to_utf(buf) {
  2126.   return toutf8(buf)
  2127. }
  2128.  
  2129. function to_base64(buf) {
  2130.   return base64.fromByteArray(buf)
  2131. }
  2132. };
  2133.  
  2134. defs["node_modules/js-git/node_modules/bops/typedarray/is.js"] = function (module, exports) {
  2135. module.exports = function(buffer) {
  2136.   return buffer instanceof Uint8Array;
  2137. }
  2138. };
  2139.  
  2140. defs["node_modules/js-git/node_modules/bops/typedarray/subarray.js"] = function (module, exports) {
  2141. module.exports = subarray
  2142.  
  2143. function subarray(buf, from, to) {
  2144.   return buf.subarray(from || 0, to || buf.length)
  2145. }
  2146. };
  2147.  
  2148. defs["node_modules/js-git/node_modules/bops/typedarray/join.js"] = function (module, exports) {
  2149. module.exports = join
  2150.  
  2151. function join(targets, hint) {
  2152.   if(!targets.length) {
  2153.     return new Uint8Array(0)
  2154.   }
  2155.  
  2156.   var len = hint !== undefined ? hint : get_length(targets)
  2157.     , out = new Uint8Array(len)
  2158.     , cur = targets[0]
  2159.     , curlen = cur.length
  2160.     , curidx = 0
  2161.     , curoff = 0
  2162.     , i = 0
  2163.  
  2164.   while(i < len) {
  2165.     if(curoff === curlen) {
  2166.       curoff = 0
  2167.       ++curidx
  2168.       cur = targets[curidx]
  2169.       curlen = cur && cur.length
  2170.       continue
  2171.     }
  2172.     out[i++] = cur[curoff++]
  2173.   }
  2174.  
  2175.   return out
  2176. }
  2177.  
  2178. function get_length(targets) {
  2179.   var size = 0
  2180.   for(var i = 0, len = targets.length; i < len; ++i) {
  2181.     size += targets[i].byteLength
  2182.   }
  2183.   return size
  2184. }
  2185. };
  2186.  
  2187. defs["node_modules/js-git/node_modules/bops/typedarray/copy.js"] = function (module, exports) {
  2188. module.exports = copy
  2189.  
  2190. var slice = [].slice
  2191.  
  2192. function copy(source, target, target_start, source_start, source_end) {
  2193.   target_start = arguments.length < 3 ? 0 : target_start
  2194.   source_start = arguments.length < 4 ? 0 : source_start
  2195.   source_end = arguments.length < 5 ? source.length : source_end
  2196.  
  2197.   if(source_end === source_start) {
  2198.     return
  2199.   }
  2200.  
  2201.   if(target.length === 0 || source.length === 0) {
  2202.     return
  2203.   }
  2204.  
  2205.   if(source_end > source.length) {
  2206.     source_end = source.length
  2207.   }
  2208.  
  2209.   if(target.length - target_start < source_end - source_start) {
  2210.     source_end = target.length - target_start + source_start
  2211.   }
  2212.  
  2213.   if(source.buffer !== target.buffer) {
  2214.     return fast_copy(source, target, target_start, source_start, source_end)
  2215.   }
  2216.   return slow_copy(source, target, target_start, source_start, source_end)
  2217. }
  2218.  
  2219. function fast_copy(source, target, target_start, source_start, source_end) {
  2220.   var len = (source_end - source_start) + target_start
  2221.  
  2222.   for(var i = target_start, j = source_start;
  2223.       i < len;
  2224.       ++i,
  2225.       ++j) {
  2226.     target[i] = source[j]
  2227.   }
  2228. }
  2229.  
  2230. function slow_copy(from, to, j, i, jend) {
  2231.   // the buffers could overlap.
  2232.   var iend = jend + i
  2233.     , tmp = new Uint8Array(slice.call(from, i, iend))
  2234.     , x = 0
  2235.  
  2236.   for(; i < iend; ++i, ++x) {
  2237.     to[j++] = tmp[x]
  2238.   }
  2239. }
  2240. };
  2241.  
  2242. defs["node_modules/js-git/node_modules/bops/typedarray/create.js"] = function (module, exports) {
  2243. module.exports = function(size) {
  2244.   return new Uint8Array(size)
  2245. }
  2246. };
  2247.  
  2248. defs["node_modules/js-git/node_modules/bops/typedarray/read.js"] = function (module, exports) {
  2249. module.exports = {
  2250.     readUInt8:      read_uint8
  2251.   , readInt8:       read_int8
  2252.   , readUInt16LE:   read_uint16_le
  2253.   , readUInt32LE:   read_uint32_le
  2254.   , readInt16LE:    read_int16_le
  2255.   , readInt32LE:    read_int32_le
  2256.   , readFloatLE:    read_float_le
  2257.   , readDoubleLE:   read_double_le
  2258.   , readUInt16BE:   read_uint16_be
  2259.   , readUInt32BE:   read_uint32_be
  2260.   , readInt16BE:    read_int16_be
  2261.   , readInt32BE:    read_int32_be
  2262.   , readFloatBE:    read_float_be
  2263.   , readDoubleBE:   read_double_be
  2264. }
  2265.  
  2266. var map = require('node_modules/js-git/node_modules/bops/typedarray/mapped.js')
  2267.  
  2268. function read_uint8(target, at) {
  2269.   return target[at]
  2270. }
  2271.  
  2272. function read_int8(target, at) {
  2273.   var v = target[at];
  2274.   return v < 0x80 ? v : v - 0x100
  2275. }
  2276.  
  2277. function read_uint16_le(target, at) {
  2278.   var dv = map.get(target);
  2279.   return dv.getUint16(at + target.byteOffset, true)
  2280. }
  2281.  
  2282. function read_uint32_le(target, at) {
  2283.   var dv = map.get(target);
  2284.   return dv.getUint32(at + target.byteOffset, true)
  2285. }
  2286.  
  2287. function read_int16_le(target, at) {
  2288.   var dv = map.get(target);
  2289.   return dv.getInt16(at + target.byteOffset, true)
  2290. }
  2291.  
  2292. function read_int32_le(target, at) {
  2293.   var dv = map.get(target);
  2294.   return dv.getInt32(at + target.byteOffset, true)
  2295. }
  2296.  
  2297. function read_float_le(target, at) {
  2298.   var dv = map.get(target);
  2299.   return dv.getFloat32(at + target.byteOffset, true)
  2300. }
  2301.  
  2302. function read_double_le(target, at) {
  2303.   var dv = map.get(target);
  2304.   return dv.getFloat64(at + target.byteOffset, true)
  2305. }
  2306.  
  2307. function read_uint16_be(target, at) {
  2308.   var dv = map.get(target);
  2309.   return dv.getUint16(at + target.byteOffset, false)
  2310. }
  2311.  
  2312. function read_uint32_be(target, at) {
  2313.   var dv = map.get(target);
  2314.   return dv.getUint32(at + target.byteOffset, false)
  2315. }
  2316.  
  2317. function read_int16_be(target, at) {
  2318.   var dv = map.get(target);
  2319.   return dv.getInt16(at + target.byteOffset, false)
  2320. }
  2321.  
  2322. function read_int32_be(target, at) {
  2323.   var dv = map.get(target);
  2324.   return dv.getInt32(at + target.byteOffset, false)
  2325. }
  2326.  
  2327. function read_float_be(target, at) {
  2328.   var dv = map.get(target);
  2329.   return dv.getFloat32(at + target.byteOffset, false)
  2330. }
  2331.  
  2332. function read_double_be(target, at) {
  2333.   var dv = map.get(target);
  2334.   return dv.getFloat64(at + target.byteOffset, false)
  2335. }
  2336. };
  2337.  
  2338. defs["node_modules/js-git/node_modules/bops/typedarray/mapped.js"] = function (module, exports) {
  2339. var proto
  2340.   , map
  2341.  
  2342. module.exports = proto = {}
  2343.  
  2344. map = typeof WeakMap === 'undefined' ? null : new WeakMap
  2345.  
  2346. proto.get = !map ? no_weakmap_get : get
  2347.  
  2348. function no_weakmap_get(target) {
  2349.   return new DataView(target.buffer, 0)
  2350. }
  2351.  
  2352. function get(target) {
  2353.   var out = map.get(target.buffer)
  2354.   if(!out) {
  2355.     map.set(target.buffer, out = new DataView(target.buffer, 0))
  2356.   }
  2357.   return out
  2358. }
  2359. };
  2360.  
  2361. defs["node_modules/js-git/node_modules/bops/typedarray/write.js"] = function (module, exports) {
  2362. module.exports = {
  2363.     writeUInt8:      write_uint8
  2364.   , writeInt8:       write_int8
  2365.   , writeUInt16LE:   write_uint16_le
  2366.   , writeUInt32LE:   write_uint32_le
  2367.   , writeInt16LE:    write_int16_le
  2368.   , writeInt32LE:    write_int32_le
  2369.   , writeFloatLE:    write_float_le
  2370.   , writeDoubleLE:   write_double_le
  2371.   , writeUInt16BE:   write_uint16_be
  2372.   , writeUInt32BE:   write_uint32_be
  2373.   , writeInt16BE:    write_int16_be
  2374.   , writeInt32BE:    write_int32_be
  2375.   , writeFloatBE:    write_float_be
  2376.   , writeDoubleBE:   write_double_be
  2377. }
  2378.  
  2379. var map = require('node_modules/js-git/node_modules/bops/typedarray/mapped.js')
  2380.  
  2381. function write_uint8(target, value, at) {
  2382.   return target[at] = value
  2383. }
  2384.  
  2385. function write_int8(target, value, at) {
  2386.   return target[at] = value < 0 ? value + 0x100 : value
  2387. }
  2388.  
  2389. function write_uint16_le(target, value, at) {
  2390.   var dv = map.get(target);
  2391.   return dv.setUint16(at + target.byteOffset, value, true)
  2392. }
  2393.  
  2394. function write_uint32_le(target, value, at) {
  2395.   var dv = map.get(target);
  2396.   return dv.setUint32(at + target.byteOffset, value, true)
  2397. }
  2398.  
  2399. function write_int16_le(target, value, at) {
  2400.   var dv = map.get(target);
  2401.   return dv.setInt16(at + target.byteOffset, value, true)
  2402. }
  2403.  
  2404. function write_int32_le(target, value, at) {
  2405.   var dv = map.get(target);
  2406.   return dv.setInt32(at + target.byteOffset, value, true)
  2407. }
  2408.  
  2409. function write_float_le(target, value, at) {
  2410.   var dv = map.get(target);
  2411.   return dv.setFloat32(at + target.byteOffset, value, true)
  2412. }
  2413.  
  2414. function write_double_le(target, value, at) {
  2415.   var dv = map.get(target);
  2416.   return dv.setFloat64(at + target.byteOffset, value, true)
  2417. }
  2418.  
  2419. function write_uint16_be(target, value, at) {
  2420.   var dv = map.get(target);
  2421.   return dv.setUint16(at + target.byteOffset, value, false)
  2422. }
  2423.  
  2424. function write_uint32_be(target, value, at) {
  2425.   var dv = map.get(target);
  2426.   return dv.setUint32(at + target.byteOffset, value, false)
  2427. }
  2428.  
  2429. function write_int16_be(target, value, at) {
  2430.   var dv = map.get(target);
  2431.   return dv.setInt16(at + target.byteOffset, value, false)
  2432. }
  2433.  
  2434. function write_int32_be(target, value, at) {
  2435.   var dv = map.get(target);
  2436.   return dv.setInt32(at + target.byteOffset, value, false)
  2437. }
  2438.  
  2439. function write_float_be(target, value, at) {
  2440.   var dv = map.get(target);
  2441.   return dv.setFloat32(at + target.byteOffset, value, false)
  2442. }
  2443.  
  2444. function write_double_be(target, value, at) {
  2445.   var dv = map.get(target);
  2446.   return dv.setFloat64(at + target.byteOffset, value, false)
  2447. }
  2448. };
  2449.  
  2450. defs["node_modules/js-git/lib/deframe.js"] = function (module, exports) {
  2451. var bops = require('node_modules/js-git/node_modules/bops/index.js');
  2452. var indexOf = require('node_modules/js-git/lib/indexof.js');
  2453. var parseDec = require('node_modules/js-git/lib/parsedec.js');
  2454. var parseAscii = require('node_modules/js-git/lib/parseascii.js');
  2455.  
  2456. module.exports = function deframe(buffer) {
  2457.   var space = indexOf(buffer, 0x20);
  2458.   if (space < 0) throw new Error("Invalid git object buffer");
  2459.   var nil = indexOf(buffer, 0x00, space);
  2460.   if (nil < 0) throw new Error("Invalid git object buffer");
  2461.   var body = bops.subarray(buffer, nil + 1);
  2462.   var size = parseDec(buffer, space + 1, nil);
  2463.   if (size !== body.length) throw new Error("Invalid body length.");
  2464.   return [
  2465.     parseAscii(buffer, 0, space),
  2466.     body
  2467.   ];
  2468. };
  2469. };
  2470.  
  2471. defs["node_modules/js-git/lib/indexof.js"] = function (module, exports) {
  2472. module.exports = function indexOf(buffer, byte, i) {
  2473.   i |= 0;
  2474.   var length = buffer.length;
  2475.   for (;;i++) {
  2476.     if (i >= length) return -1;
  2477.     if (buffer[i] === byte) return i;
  2478.   }
  2479. };
  2480. };
  2481.  
  2482. defs["node_modules/js-git/lib/parsedec.js"] = function (module, exports) {
  2483. module.exports = function parseDec(buffer, start, end) {
  2484.   var val = 0;
  2485.   while (start < end) {
  2486.     val = val * 10 + buffer[start++] - 0x30;
  2487.   }
  2488.   return val;
  2489. };
  2490. };
  2491.  
  2492. defs["node_modules/js-git/lib/parseascii.js"] = function (module, exports) {
  2493. module.exports = function parseAscii(buffer, start, end) {
  2494.   var val = "";
  2495.   while (start < end) {
  2496.     val += String.fromCharCode(buffer[start++]);
  2497.   }
  2498.   return val;
  2499. };
  2500. };
  2501.  
  2502. defs["node_modules/js-git/lib/encoders.js"] = function (module, exports) {
  2503. var bops = require('node_modules/js-git/node_modules/bops/index.js');
  2504. var pathCmp = require('node_modules/js-git/lib/pathcmp.js');
  2505.  
  2506. exports.commit = function encodeCommit(commit) {
  2507.   if (!commit.tree || !commit.author || !commit.message) {
  2508.     throw new TypeError("Tree, author, and message are require for commits");
  2509.   }
  2510.   var parents = commit.parents || (commit.parent ? [ commit.parent ] : []);
  2511.   if (!Array.isArray(parents)) {
  2512.     throw new TypeError("Parents must be an array");
  2513.   }
  2514.   var str = "tree " + commit.tree;
  2515.   for (var i = 0, l = parents.length; i < l; ++i) {
  2516.     str += "\nparent " + parents[i];
  2517.   }
  2518.   str += "\nauthor " + encodePerson(commit.author) +
  2519.          "\ncommitter " + encodePerson(commit.committer || commit.author) +
  2520.          "\n\n" + commit.message;
  2521.   return bops.from(str);
  2522. };
  2523.  
  2524. exports.tag = function encodeTag(tag) {
  2525.   if (!tag.object || !tag.type || !tag.tag || !tag.tagger || !tag.message) {
  2526.     throw new TypeError("Object, type, tag, tagger, and message required");
  2527.   }
  2528.   var str = "object " + tag.object +
  2529.     "\ntype " + tag.type +
  2530.     "\ntag " + tag.tag +
  2531.     "\ntagger " + encodePerson(tag.tagger) +
  2532.     "\n\n" + tag.message;
  2533.   return bops.from(str + "\n" + tag.message);
  2534. };
  2535.  
  2536. exports.tree = function encodeTree(tree) {
  2537.   var chunks = [];
  2538.   if (!Array.isArray(tree)) {
  2539.     tree = Object.keys(tree).map(function (name) {
  2540.       var entry = tree[name];
  2541.       entry.name = name;
  2542.       return entry;
  2543.     });
  2544.   }
  2545.   tree.sort(pathCmp).forEach(onEntry);
  2546.   return bops.join(chunks);
  2547.  
  2548.   function onEntry(entry) {
  2549.     chunks.push(
  2550.       bops.from(entry.mode.toString(8) + " " + entry.name + "\0"),
  2551.       bops.from(entry.hash, "hex")
  2552.     );
  2553.   }
  2554. };
  2555.  
  2556. exports.blob = function encodeBlob(blob) {
  2557.   if (bops.is(blob)) return blob;
  2558.   return bops.from(blob);
  2559. };
  2560.  
  2561. function encodePerson(person) {
  2562.   if (!person.name || !person.email) {
  2563.     throw new TypeError("Name and email are required for person fields");
  2564.   }
  2565.   return safe(person.name) +
  2566.     " <" + safe(person.email) + "> " +
  2567.     formatDate(person.date || new Date());
  2568. }
  2569.  
  2570. function safe(string) {
  2571.   return string.replace(/(?:^[\.,:;<>"']+|[\0\n<>]+|[\.,:;<>"']+$)/gm, "");
  2572. }
  2573.  
  2574. function formatDate(date) {
  2575.   var timezone = (date.timeZoneoffset || date.getTimezoneOffset()) / 60;
  2576.   var seconds = Math.floor(date.getTime() / 1000);
  2577.   return seconds + " " + (timezone > 0 ? "-0" : "0") + timezone + "00";
  2578. }
  2579. };
  2580.  
  2581. defs["node_modules/js-git/lib/pathcmp.js"] = function (module, exports) {
  2582. module.exports = function pathCmp(oa, ob) {
  2583.   var a = oa.name;
  2584.   var b = ob.name;
  2585.   a += "/"; b += "/";
  2586.   return a < b ? -1 : a > b ? 1 : 0;
  2587. };
  2588. };
  2589.  
  2590. defs["node_modules/js-git/lib/decoders.js"] = function (module, exports) {
  2591. var indexOf = require('node_modules/js-git/lib/indexof.js');
  2592. var parseOct = require('node_modules/js-git/lib/parseoct.js');
  2593. var parseAscii = require('node_modules/js-git/lib/parseascii.js');
  2594. var parseToHex = require('node_modules/js-git/lib/parsetohex.js');
  2595.  
  2596. exports.commit = function decodeCommit(body) {
  2597.   var i = 0;
  2598.   var start;
  2599.   var key;
  2600.   var parents = [];
  2601.   var commit = {
  2602.     tree: "",
  2603.     parents: parents,
  2604.     author: "",
  2605.     committer: "",
  2606.     message: ""
  2607.   };
  2608.   while (body[i] !== 0x0a) {
  2609.     start = i;
  2610.     i = indexOf(body, 0x20, start);
  2611.     if (i < 0) throw new SyntaxError("Missing space");
  2612.     key = parseAscii(body, start, i++);
  2613.     start = i;
  2614.     i = indexOf(body, 0x0a, start);
  2615.     if (i < 0) throw new SyntaxError("Missing linefeed");
  2616.     var value = parseAscii(body, start, i++);
  2617.     if (key === "parent") {
  2618.       parents.push(value);
  2619.     }
  2620.     else {
  2621.       if (key === "author" || key === "committer") {
  2622.         value = decodePerson(value);
  2623.       }
  2624.       commit[key] = value;
  2625.     }
  2626.   }
  2627.   i++;
  2628.   commit.message = parseAscii(body, i, body.length);
  2629.   return commit;
  2630. };
  2631.  
  2632. exports.tag = function decodeTag(body) {
  2633.   var i = 0;
  2634.   var start;
  2635.   var key;
  2636.   var tag = {};
  2637.   while (body[i] !== 0x0a) {
  2638.     start = i;
  2639.     i = indexOf(body, 0x20, start);
  2640.     if (i < 0) throw new SyntaxError("Missing space");
  2641.     key = parseAscii(body, start, i++);
  2642.     start = i;
  2643.     i = indexOf(body, 0x0a, start);
  2644.     if (i < 0) throw new SyntaxError("Missing linefeed");
  2645.     var value = parseAscii(body, start, i++);
  2646.     if (key === "tagger") value = decodePerson(value);
  2647.     tag[key] = value;
  2648.   }
  2649.   i++;
  2650.   tag.message = parseAscii(body, i, body.length);
  2651.   return tag;
  2652. };
  2653.  
  2654. exports.tree = function decodeTree(body) {
  2655.   var i = 0;
  2656.   var length = body.length;
  2657.   var start;
  2658.   var mode;
  2659.   var name;
  2660.   var hash;
  2661.   var tree = {};
  2662.   while (i < length) {
  2663.     start = i;
  2664.     i = indexOf(body, 0x20, start);
  2665.     if (i < 0) throw new SyntaxError("Missing space");
  2666.     mode = parseOct(body, start, i++);
  2667.     start = i;
  2668.     i = indexOf(body, 0x00, start);
  2669.     name = parseAscii(body, start, i++);
  2670.     hash = parseToHex(body, i, i += 20);
  2671.     tree[name] = {
  2672.       mode: mode,
  2673.       hash: hash
  2674.     };
  2675.   }
  2676.   return tree;
  2677. };
  2678.  
  2679. exports.blob = function decodeBlob(body) {
  2680.   return body;
  2681. };
  2682.  
  2683. function decodePerson(string) {
  2684.   var match = string.match(/^([^<]*) <([^>]*)> ([^ ]*) (.*)$/);
  2685.   if (!match) throw new Error("Improperly formatted person string");
  2686.   var sec = parseInt(match[3], 10);
  2687.   var date = new Date(sec * 1000);
  2688.   date.timeZoneoffset = parseInt(match[4], 10) / 100 * -60;
  2689.   return {
  2690.     name: match[1],
  2691.     email: match[2],
  2692.     date: date
  2693.   };
  2694. }
  2695. };
  2696.  
  2697. defs["node_modules/js-git/lib/parseoct.js"] = function (module, exports) {
  2698. module.exports = function parseOct(buffer, start, end) {
  2699.   var val = 0;
  2700.   while (start < end) {
  2701.     val = (val << 3) + buffer[start++] - 0x30;
  2702.   }
  2703.   return val;
  2704. };
  2705. };
  2706.  
  2707. defs["node_modules/js-git/lib/parsetohex.js"] = function (module, exports) {
  2708. var chars = "0123456789abcdef";
  2709.  
  2710. module.exports = function parseToHex(buffer, start, end) {
  2711.   var val = "";
  2712.   while (start < end) {
  2713.     var byte = buffer[start++];
  2714.     val += chars[byte >> 4] + chars[byte & 0xf];
  2715.   }
  2716.   return val;
  2717. };
  2718. };
  2719.  
  2720. defs["node_modules/js-git/lib/ishash.js"] = function (module, exports) {
  2721. module.exports = function isHash(hash) {
  2722.   return (/^[0-9a-f]{40}$/).test(hash);
  2723. };
  2724. };
  2725.  
  2726. defs["node_modules/js-git/mixins/refs.js"] = function (module, exports) {
  2727. var isHash = require('node_modules/js-git/lib/ishash.js');
  2728.  
  2729. module.exports = function (repo) {
  2730.   // Refs
  2731.   repo.resolve = resolve;       // (hash-ish) -> hash
  2732.   repo.updateHead = updateHead; // (hash)
  2733.   repo.getHead = getHead;       // () -> ref
  2734.   repo.setHead = setHead;       // (ref)
  2735.   repo.readRef = readRef;       // (ref) -> hash
  2736.   repo.createRef = createRef;   // (ref, hash)
  2737.   repo.updateRef = updateRef;   // (ref, hash)
  2738.   repo.deleteRef = deleteRef;   // (ref)
  2739.   repo.listRefs = listRefs;     // (prefix) -> refs
  2740. };
  2741.  
  2742. function resolve(hashish, callback) {
  2743.   if (!callback) return resolve.bind(this, hashish);
  2744.   hashish = hashish.trim();
  2745.   var repo = this, db = repo.db;
  2746.   if (isHash(hashish)) return callback(null, hashish);
  2747.   if (hashish === "HEAD") return repo.getHead(onBranch);
  2748.   if ((/^refs\//).test(hashish)) {
  2749.     return db.get(hashish, checkBranch);
  2750.   }
  2751.   return checkBranch();
  2752.  
  2753.   function onBranch(err, ref) {
  2754.     if (err) return callback(err);
  2755.     if (!ref) return callback();
  2756.     return repo.resolve(ref, callback);
  2757.   }
  2758.  
  2759.   function checkBranch(err, hash) {
  2760.     if (err && err.code !== "ENOENT") return callback(err);
  2761.     if (hash) {
  2762.       return repo.resolve(hash, callback);
  2763.     }
  2764.     return db.get("refs/heads/" + hashish, checkTag);
  2765.   }
  2766.  
  2767.   function checkTag(err, hash) {
  2768.     if (err && err.code !== "ENOENT") return callback(err);
  2769.     if (hash) {
  2770.       return repo.resolve(hash, callback);
  2771.     }
  2772.     return db.get("refs/tags/" + hashish, final);
  2773.   }
  2774.  
  2775.   function final(err, hash) {
  2776.     if (err) return callback(err);
  2777.     if (hash) {
  2778.       return repo.resolve(hash, callback);
  2779.     }
  2780.     err = new Error("ENOENT: Cannot find " + hashish);
  2781.     err.code = "ENOENT";
  2782.     return callback(err);
  2783.   }
  2784. }
  2785.  
  2786. function updateHead(hash, callback) {
  2787.   if (!callback) return updateHead.bind(this, hash);
  2788.   var ref;
  2789.   var repo = this, db = repo.db;
  2790.   return this.getHead(onBranch);
  2791.  
  2792.   function onBranch(err, result) {
  2793.     if (err) return callback(err);
  2794.     if (result === undefined) {
  2795.       return repo.setHead("master", function (err) {
  2796.         if (err) return callback(err);
  2797.         onBranch(err, "refs/heads/master");
  2798.       });
  2799.     }
  2800.     ref = result;
  2801.     return db.set(ref, hash + "\n", callback);
  2802.   }
  2803. }
  2804.  
  2805. function getHead(callback) {
  2806.   if (!callback) return getHead.bind(this);
  2807.   var repo = this, db = repo.db;
  2808.   return db.get("HEAD", onRead);
  2809.  
  2810.   function onRead(err, ref) {
  2811.     if (err) return callback(err);
  2812.     if (!ref) return callback();
  2813.     var match = ref.match(/^ref: *(.*)/);
  2814.     if (!match) return callback(new Error("Invalid HEAD"));
  2815.     return callback(null, match[1]);
  2816.   }
  2817. }
  2818.  
  2819. function setHead(branchName, callback) {
  2820.   if (!callback) return setHead.bind(this, branchName);
  2821.   var ref = "refs/heads/" + branchName;
  2822.   return this.db.set("HEAD", "ref: " + ref + "\n", callback);
  2823. }
  2824.  
  2825. function readRef(ref, callback) {
  2826.   if (!callback) return readRef.bind(this, ref);
  2827.   return this.db.get(ref, function (err, result) {
  2828.     if (err) return callback(err);
  2829.     if (!result) return callback();
  2830.     return callback(null, result.trim());
  2831.   });
  2832. }
  2833.  
  2834. function createRef(ref, hash, callback) {
  2835.   if (!callback) return createRef.bind(this, ref, hash);
  2836.   // TODO: should we check to make sure it doesn't exist first?
  2837.   return this.db.set(ref, hash + "\n", callback);
  2838. }
  2839.  
  2840. function updateRef(ref, hash, callback) {
  2841.   if (!callback) return updateRef.bind(this, ref, hash);
  2842.   // TODO: should we check to make sure it does exist first?
  2843.   return this.db.set(ref, hash + "\n", callback);
  2844. }
  2845.  
  2846. function deleteRef(ref, callback) {
  2847.   if (!callback) return deleteRef.bind(this, ref);
  2848.   return this.db.del(ref, callback);
  2849. }
  2850.  
  2851. function listRefs(prefix, callback) {
  2852.   if (!callback) return listRefs.bind(this, prefix);
  2853.   if (!prefix) prefix = "refs\/";
  2854.   else if (!/^refs\//.test(prefix)) {
  2855.     return callback(new TypeError("Invalid prefix: " + prefix));
  2856.   }
  2857.   var db = this.db;
  2858.   var refs = {};
  2859.   return db.keys(prefix, onKeys);
  2860.  
  2861.   function onKeys(err, keys) {
  2862.     if (err) return callback(err);
  2863.     var left = keys.length, done = false;
  2864.     if (!left) return callback(null, refs);
  2865.     keys.forEach(function (key) {
  2866.       db.get(key, function (err, value) {
  2867.         if (done) return;
  2868.         if (err) {
  2869.           done = true;
  2870.           return callback(err);
  2871.         }
  2872.         refs[key] = value.trim();
  2873.         if (--left) return;
  2874.         done = true;
  2875.         callback(null, refs);
  2876.       });
  2877.     });
  2878.   }
  2879. }
  2880. };
  2881.  
  2882. defs["node_modules/js-git/mixins/walkers.js"] = function (module, exports) {
  2883. var walk = require('node_modules/js-git/lib/walk.js');
  2884. var assertType = require('node_modules/js-git/lib/assert-type.js');
  2885.  
  2886. module.exports = function (repo) {
  2887.   repo.logWalk = logWalk;   // (hash-ish) => stream<commit>
  2888.   repo.treeWalk = treeWalk; // (hash-ish) => stream<object>
  2889. };
  2890.  
  2891. function logWalk(hashish, callback) {
  2892.   if (!callback) return logWalk.bind(this, hashish);
  2893.   var last, seen = {};
  2894.   var repo = this;
  2895.   return repo.readRef("shallow", onShallow);
  2896.  
  2897.   function onShallow(err, shallow) {
  2898.     last = shallow;
  2899.     return repo.loadAs("commit", hashish, onLoad);
  2900.   }
  2901.  
  2902.   function onLoad(err, commit, hash) {
  2903.     if (commit === undefined) return callback(err);
  2904.     commit.hash = hash;
  2905.     seen[hash] = true;
  2906.     return callback(null, walk(commit, scan, loadKey, compare));
  2907.   }
  2908.  
  2909.   function scan(commit) {
  2910.     if (last === commit) return [];
  2911.     return commit.parents.filter(function (hash) {
  2912.       return !seen[hash];
  2913.     });
  2914.   }
  2915.  
  2916.   function loadKey(hash, callback) {
  2917.     return repo.loadAs("commit", hash, function (err, commit) {
  2918.       if (err) return callback(err);
  2919.       commit.hash = hash;
  2920.       if (hash === last) commit.last = true;
  2921.       return callback(null, commit);
  2922.     });
  2923.   }
  2924.  
  2925. }
  2926.  
  2927. function compare(commit, other) {
  2928.   return commit.author.date < other.author.date;
  2929. }
  2930.  
  2931. function treeWalk(hashish, callback) {
  2932.   if (!callback) return treeWalk.bind(this, hashish);
  2933.   var repo = this;
  2934.   return repo.load(hashish, onLoad);
  2935.   function onLoad(err, item, hash) {
  2936.     if (err) return callback(err);
  2937.     if (item.type === "commit") return repo.load(item.body.tree, onLoad);
  2938.     item.hash = hash;
  2939.     item.path = "/";
  2940.     return callback(null, walk(item, treeScan, treeLoadKey, treeCompare));
  2941.   }
  2942.  
  2943.   function treeLoadKey(entry, callback) {
  2944.     return repo.load(entry.hash, function (err, object) {
  2945.       if (err) return callback(err);
  2946.       entry.type = object.type;
  2947.       entry.body = object.body;
  2948.       return callback(null, entry);
  2949.     });
  2950.   }
  2951.  
  2952. }
  2953.  
  2954. function treeScan(object) {
  2955.   if (object.type === "blob") return [];
  2956.   assertType(object, "tree");
  2957.   return object.body.filter(function (entry) {
  2958.     return entry.mode !== 0160000;
  2959.   }).map(function (entry) {
  2960.     var path = object.path + entry.name;
  2961.     if (entry.mode === 040000) path += "/";
  2962.     entry.path = path;
  2963.     return entry;
  2964.   });
  2965. }
  2966.  
  2967. function treeCompare(first, second) {
  2968.   return first.path < second.path;
  2969. }
  2970. };
  2971.  
  2972. defs["node_modules/js-git/lib/walk.js"] = function (module, exports) {
  2973. module.exports = function walk(seed, scan, loadKey, compare) {
  2974.   var queue = [seed];
  2975.   var working = 0, error, cb;
  2976.   return {read: read, abort: abort};
  2977.  
  2978.   function read(callback) {
  2979.     if (cb) return callback(new Error("Only one read at a time"));
  2980.     if (working) { cb = callback; return; }
  2981.     var item = queue.shift();
  2982.     if (!item) return callback();
  2983.     try { scan(item).forEach(onKey); }
  2984.     catch (err) { return callback(err); }
  2985.     return callback(null, item);
  2986.   }
  2987.  
  2988.   function abort(callback) { return callback(); }
  2989.  
  2990.   function onError(err) {
  2991.     if (cb) {
  2992.       var callback = cb; cb = null;
  2993.       return callback(err);
  2994.     }
  2995.     error = err;
  2996.   }
  2997.  
  2998.   function onKey(key) {
  2999.     working++;
  3000.     loadKey(key, onItem);
  3001.   }
  3002.  
  3003.   function onItem(err, item) {
  3004.     working--;
  3005.     if (err) return onError(err);
  3006.     var index = queue.length;
  3007.     while (index && compare(item, queue[index - 1])) index--;
  3008.     queue.splice(index, 0, item);
  3009.     if (!working && cb) {
  3010.       var callback = cb; cb = null;
  3011.       return read(callback);
  3012.     }
  3013.   }
  3014. };
  3015. };
  3016.  
  3017. defs["node_modules/js-git/lib/assert-type.js"] = function (module, exports) {
  3018. module.exports = function assertType(object, type) {
  3019.   if (object.type !== type) {
  3020.     throw new Error(type + " expected, but found " + object.type);
  3021.   }
  3022. };
  3023. };
  3024.  
  3025. defs["node_modules/js-git/mixins/packops.js"] = function (module, exports) {
  3026. var bops = require('node_modules/js-git/node_modules/bops/index.js');
  3027. var deframe = require('node_modules/js-git/lib/deframe.js');
  3028. var frame = require('node_modules/js-git/lib/frame.js');
  3029. var sha1 = require('node_modules/js-git/lib/sha1.js');
  3030. var applyDelta = require('node_modules/js-git/lib/apply-delta.js');
  3031. var pushToPull = require('node_modules/js-git/node_modules/push-to-pull/transform.js');
  3032. var decodePack = require('node_modules/js-git/lib/pack-codec.js').decodePack;
  3033. var packFrame = require('node_modules/js-git/lib/pack-codec.js').packFrame;
  3034.  
  3035. module.exports = function (repo) {
  3036.   // packStream is a simple-stream containing raw packfile binary data
  3037.   // opts can contain "onProgress" or "onError" hook functions.
  3038.   // callback will be called with a list of all unpacked hashes on success.
  3039.   repo.unpack = unpack; // (packStream, opts) -> hashes
  3040.  
  3041.   // hashes is an array of hashes to pack
  3042.   // callback will be a simple-stream containing raw packfile binary data
  3043.   repo.pack = pack;     // (hashes, opts) -> packStream
  3044. };
  3045.  
  3046. function unpack(packStream, opts, callback) {
  3047.   if (!callback) return unpack.bind(this, packStream, opts);
  3048.  
  3049.   packStream = pushToPull(decodePack)(packStream);
  3050.  
  3051.   var repo = this;
  3052.  
  3053.   var version, num, numDeltas = 0, count = 0, countDeltas = 0;
  3054.   var done, startDeltaProgress = false;
  3055.  
  3056.   // hashes keyed by offset for ofs-delta resolving
  3057.   var hashes = {};
  3058.   // key is hash, boolean is cached "has" value of true or false
  3059.   var has = {};
  3060.   // key is hash we're waiting for, value is array of items that are waiting.
  3061.   var pending = {};
  3062.  
  3063.   return packStream.read(onStats);
  3064.  
  3065.   function onDone(err) {
  3066.     if (done) return;
  3067.     done = true;
  3068.     if (err) return callback(err);
  3069.     return callback(null, values(hashes));
  3070.   }
  3071.  
  3072.   function onStats(err, stats) {
  3073.     if (err) return onDone(err);
  3074.     version = stats.version;
  3075.     num = stats.num;
  3076.     packStream.read(onRead);
  3077.   }
  3078.  
  3079.   function objectProgress(more) {
  3080.     if (!more) startDeltaProgress = true;
  3081.     var percent = Math.round(count / num * 100);
  3082.     return opts.onProgress("Receiving objects: " + percent + "% (" + (count++) + "/" + num + ")   " + (more ? "\r" : "\n"));
  3083.   }
  3084.  
  3085.   function deltaProgress(more) {
  3086.     if (!startDeltaProgress) return;
  3087.     var percent = Math.round(countDeltas / numDeltas * 100);
  3088.     return opts.onProgress("Applying deltas: " + percent + "% (" + (countDeltas++) + "/" + numDeltas + ")   " + (more ? "\r" : "\n"));
  3089.   }
  3090.  
  3091.   function onRead(err, item) {
  3092.     if (err) return onDone(err);
  3093.     if (opts.onProgress) objectProgress(item);
  3094.     if (item === undefined) return onDone();
  3095.     if (item.size !== item.body.length) {
  3096.       return onDone(new Error("Body size mismatch"));
  3097.     }
  3098.     if (item.type === "ofs-delta") {
  3099.       numDeltas++;
  3100.       item.ref = hashes[item.offset - item.ref];
  3101.       return resolveDelta(item);
  3102.     }
  3103.     if (item.type === "ref-delta") {
  3104.       numDeltas++;
  3105.       return checkDelta(item);
  3106.     }
  3107.     return saveValue(item);
  3108.   }
  3109.  
  3110.   function resolveDelta(item) {
  3111.     if (opts.onProgress) deltaProgress();
  3112.     return repo.loadRaw(item.ref, function (err, buffer) {
  3113.       if (err) return onDone(err);
  3114.       if (!buffer) return onDone(new Error("Missing base image at " + item.ref));
  3115.       var target = deframe(buffer);
  3116.       item.type = target[0];
  3117.       item.body = applyDelta(item.body, target[1]);
  3118.       return saveValue(item);
  3119.     });
  3120.   }
  3121.  
  3122.   function checkDelta(item) {
  3123.     var hasTarget = has[item.ref];
  3124.     if (hasTarget === true) return resolveDelta(item);
  3125.     if (hasTarget === false) return enqueueDelta(item);
  3126.     return repo.has(item.ref, function (err, value) {
  3127.       if (err) return onDone(err);
  3128.       has[item.ref] = value;
  3129.       if (value) return resolveDelta(item);
  3130.       return enqueueDelta(item);
  3131.     });
  3132.   }
  3133.  
  3134.   function saveValue(item) {
  3135.     var buffer = frame(item.type, item.body);
  3136.     var hash = sha1(buffer);
  3137.     hashes[item.offset] = hash;
  3138.     has[hash] = true;
  3139.     if (hash in pending) {
  3140.       // I have yet to come across a pack stream that actually needs this.
  3141.       // So I will only implement it when I have concrete data to test against.
  3142.       console.error({
  3143.         list: pending[hash],
  3144.         item: item
  3145.       });
  3146.       throw "TODO: pending value was found, resolve it";
  3147.     }
  3148.     return repo.saveRaw(hash, buffer, onSave);
  3149.   }
  3150.  
  3151.   function onSave(err) {
  3152.     if (err) return callback(err);
  3153.     packStream.read(onRead);
  3154.   }
  3155.  
  3156.   function enqueueDelta(item) {
  3157.     var list = pending[item.ref];
  3158.     if (!list) pending[item.ref] = [item];
  3159.     else list.push(item);
  3160.     packStream.read(onRead);
  3161.   }
  3162.  
  3163. }
  3164.  
  3165. // TODO: Implement delta refs to reduce stream size
  3166. function pack(hashes, opts, callback) {
  3167.   if (!callback) return pack.bind(this, hashes, opts);
  3168.   var repo = this;
  3169.   var sha1sum = sha1();
  3170.   var i = 0, first = true, done = false;
  3171.   return callback(null, { read: read, abort: callback });
  3172.  
  3173.   function read(callback) {
  3174.     if (done) return callback();
  3175.     if (first) return readFirst(callback);
  3176.     var hash = hashes[i++];
  3177.     if (hash === undefined) {
  3178.       var sum = sha1sum.digest();
  3179.       done = true;
  3180.       return callback(null, bops.from(sum, "hex"));
  3181.     }
  3182.     repo.loadRaw(hash, function (err, buffer) {
  3183.       if (err) return callback(err);
  3184.       if (!buffer) return callback(new Error("Missing hash: " + hash));
  3185.       // Reframe with pack format header
  3186.       var pair = deframe(buffer);
  3187.       packFrame(pair[0], pair[1], function (err, buffer) {
  3188.         if (err) return callback(err);
  3189.         sha1sum.update(buffer);
  3190.         callback(null, buffer);
  3191.       });
  3192.     });
  3193.   }
  3194.  
  3195.   function readFirst(callback) {
  3196.     var length = hashes.length;
  3197.     var chunk = bops.create([
  3198.       0x50, 0x41, 0x43, 0x4b, // PACK
  3199.       0, 0, 0, 2,             // version 2
  3200.       length >> 24,           // Num of objects
  3201.       (length >> 16) & 0xff,
  3202.       (length >> 8) & 0xff,
  3203.       length & 0xff
  3204.     ]);
  3205.     first = false;
  3206.     sha1sum.update(chunk);
  3207.     callback(null, chunk);
  3208.   }
  3209. }
  3210.  
  3211. function values(object) {
  3212.   var keys = Object.keys(object);
  3213.   var length = keys.length;
  3214.   var out = new Array(length);
  3215.   for (var i = 0; i < length; i++) {
  3216.     out[i] = object[keys[i]];
  3217.   }
  3218.   return out;
  3219. }
  3220. };
  3221.  
  3222. defs["node_modules/js-git/lib/apply-delta.js"] = function (module, exports) {
  3223. // This is Chris Dickinson's code
  3224.  
  3225. var binary = require('node_modules/js-git/node_modules/bops/index.js')
  3226.   , Decoder = require('node_modules/js-git/node_modules/varint/decode.js')
  3227.   , vi = new Decoder
  3228.  
  3229. // we use writeUint[8|32][LE|BE] instead of indexing
  3230. // into buffers so that we get buffer-browserify compat.
  3231. var OFFSET_BUFFER = binary.create(4)
  3232.   , LENGTH_BUFFER = binary.create(4)
  3233.  
  3234. module.exports = apply_delta;
  3235. function apply_delta(delta, target) {
  3236.   var base_size_info = {size: null, buffer: null}
  3237.     , resized_size_info = {size: null, buffer: null}
  3238.     , output_buffer
  3239.     , out_idx
  3240.     , command
  3241.     , len
  3242.     , idx
  3243.  
  3244.   delta_header(delta, base_size_info)
  3245.   delta_header(base_size_info.buffer, resized_size_info)
  3246.  
  3247.   delta = resized_size_info.buffer
  3248.  
  3249.   idx =
  3250.   out_idx = 0
  3251.   output_buffer = binary.create(resized_size_info.size)
  3252.  
  3253.   len = delta.length
  3254.  
  3255.   while(idx < len) {
  3256.     command = delta[idx++]
  3257.     command & 0x80 ? copy() : insert()
  3258.   }
  3259.  
  3260.   return output_buffer
  3261.  
  3262.   function copy() {
  3263.     binary.writeUInt32LE(OFFSET_BUFFER, 0, 0)
  3264.     binary.writeUInt32LE(LENGTH_BUFFER, 0, 0)
  3265.  
  3266.     var check = 1
  3267.       , length
  3268.       , offset
  3269.  
  3270.     for(var x = 0; x < 4; ++x) {
  3271.       if(command & check) {
  3272.         OFFSET_BUFFER[3 - x] = delta[idx++]
  3273.       }
  3274.       check <<= 1
  3275.     }
  3276.  
  3277.     for(var x = 0; x < 3; ++x) {
  3278.       if(command & check) {
  3279.         LENGTH_BUFFER[3 - x] = delta[idx++]
  3280.       }
  3281.       check <<= 1
  3282.     }
  3283.     LENGTH_BUFFER[0] = 0
  3284.  
  3285.     length = binary.readUInt32BE(LENGTH_BUFFER, 0) || 0x10000
  3286.     offset = binary.readUInt32BE(OFFSET_BUFFER, 0)
  3287.  
  3288.     binary.copy(target, output_buffer, out_idx, offset, offset + length)
  3289.     out_idx += length
  3290.   }
  3291.  
  3292.   function insert() {
  3293.     binary.copy(delta, output_buffer, out_idx, idx, command + idx)
  3294.     idx += command
  3295.     out_idx += command
  3296.   }
  3297. }
  3298.  
  3299. function delta_header(buf, output) {
  3300.   var done = false
  3301.     , idx = 0
  3302.     , size = 0
  3303.  
  3304.   vi.ondata = function(s) {
  3305.     size = s
  3306.     done = true
  3307.   }
  3308.  
  3309.   do {
  3310.     vi.write(buf[idx++])
  3311.   } while(!done)
  3312.  
  3313.   output.size = size
  3314.   output.buffer = binary.subarray(buf, idx)
  3315.  
  3316. }
  3317. };
  3318.  
  3319. defs["node_modules/js-git/node_modules/varint/decode.js"] = function (module, exports) {
  3320. module.exports = Decoder
  3321.  
  3322. var MSB = 0x80
  3323.   , REST = 0x7F
  3324.  
  3325.  
  3326. function Decoder() {
  3327.   this.accum = []
  3328. }
  3329. Decoder.prototype.write = write;
  3330.  
  3331. function write(byte) {
  3332.   var msb = byte & MSB
  3333.     , accum = this.accum
  3334.     , len
  3335.     , out
  3336.  
  3337.   accum[accum.length] = byte & REST
  3338.   if(msb) {
  3339.     return
  3340.   }
  3341.  
  3342.   len = accum.length
  3343.   out = 0
  3344.  
  3345.   for(var i = 0; i < len; ++i) {
  3346.     out |= accum[i] << (7 * i)
  3347.   }
  3348.  
  3349.   accum.length = 0
  3350.   this.ondata(out)
  3351.   return
  3352. }
  3353. };
  3354.  
  3355. defs["node_modules/js-git/node_modules/push-to-pull/transform.js"] = function (module, exports) {
  3356. // input push-filter: (emit) -> emit
  3357. // output is simple-stream pull-filter: (stream) -> stream
  3358. module.exports = pushToPull;
  3359. function pushToPull(parser) {
  3360.   return function (stream) {
  3361.  
  3362.     var write = parser(onData);
  3363.     var cb = null;
  3364.     var queue = [];
  3365.      
  3366.     return { read: read, abort: stream.abort };
  3367.    
  3368.     function read(callback) {
  3369.       if (queue.length) return callback(null, queue.shift());
  3370.       if (cb) return callback(new Error("Only one read at a time."));
  3371.       cb = callback;
  3372.       stream.read(onRead);
  3373.      
  3374.     }
  3375.  
  3376.     function onRead(err, item) {
  3377.       var callback = cb;
  3378.       cb = null;
  3379.       if (err) return callback(err);
  3380.       try {
  3381.         write(item);
  3382.       }
  3383.       catch (err) {
  3384.         return callback(err);
  3385.       }
  3386.       return read(callback);
  3387.     }
  3388.  
  3389.     function onData(item) {
  3390.       queue.push(item);
  3391.     }
  3392.  
  3393.   };
  3394. }
  3395. };
  3396.  
  3397. defs["node_modules/js-git/lib/pack-codec.js"] = function (module, exports) {
  3398. var inflate = require('node_modules/js-git/lib/inflate.js');
  3399. var deflate = require('node_modules/js-git/lib/deflate.js');
  3400. var sha1 = require('node_modules/js-git/lib/sha1.js');
  3401. var bops = {
  3402.   subarray: require('node_modules/js-git/node_modules/bops/typedarray/subarray.js'),
  3403.   join: require('node_modules/js-git/node_modules/bops/typedarray/join.js'),
  3404.   from: require('node_modules/js-git/node_modules/bops/typedarray/from.js'),
  3405. };
  3406.  
  3407. var typeToNum = {
  3408.   commit: 1,
  3409.   tree: 2,
  3410.   blob: 3,
  3411.   tag: 4,
  3412.   "ofs-delta": 6,
  3413.   "ref-delta": 7
  3414. };
  3415. var numToType = {};
  3416. for (var type in typeToNum) {
  3417.   var num = typeToNum[type];
  3418.   numToType[num] = type;
  3419. }
  3420.  
  3421. exports.packFrame = packFrame;
  3422. function packFrame(type, body, callback) {
  3423.   var length = body.length;
  3424.   var head = [(typeToNum[type] << 4) | (length & 0xf)];
  3425.   var i = 0;
  3426.   length >>= 4;
  3427.   while (length) {
  3428.     head[i++] |= 0x80;
  3429.     head[i] = length & 0x7f;
  3430.     length >>= 7;
  3431.   }
  3432.   deflate(body, function (err, body) {
  3433.     if (err) return callback(err);
  3434.     callback(null, bops.join([bops.from(head), body]));
  3435.   });
  3436. }
  3437.  
  3438. exports.decodePack = decodePack;
  3439. function decodePack(emit) {
  3440.  
  3441.   var state = $pack;
  3442.   var sha1sum = sha1();
  3443.   var inf = inflate();
  3444.  
  3445.   var offset = 0;
  3446.   var position = 0;
  3447.   var version = 0x4b434150; // PACK reversed
  3448.   var num = 0;
  3449.   var type = 0;
  3450.   var length = 0;
  3451.   var ref = null;
  3452.   var checksum = "";
  3453.   var start = 0;
  3454.   var parts = [];
  3455.  
  3456.  
  3457.   return function (chunk) {
  3458.     if (chunk === undefined) {
  3459.       if (num || checksum.length < 40) throw new Error("Unexpected end of input stream");
  3460.       return emit();
  3461.     }
  3462.  
  3463.     for (var i = 0, l = chunk.length; i < l; i++) {
  3464.       // console.log([state, i, chunk[i].toString(16)]);
  3465.       if (!state) throw new Error("Unexpected extra bytes: " + bops.subarray(chunk, i));
  3466.       state = state(chunk[i], i, chunk);
  3467.       position++;
  3468.     }
  3469.     if (!state) return;
  3470.     if (state !== $checksum) sha1sum.update(chunk);
  3471.     var buff = inf.flush();
  3472.     if (buff.length) {
  3473.       parts.push(buff);
  3474.     }
  3475.   };
  3476.  
  3477.   // The first four bytes in a packfile are the bytes 'PACK'
  3478.   function $pack(byte) {
  3479.     if ((version & 0xff) === byte) {
  3480.       version >>>= 8;
  3481.       return version ? $pack : $version;
  3482.     }
  3483.     throw new Error("Invalid packfile header");
  3484.   }
  3485.  
  3486.   // The version is stored as an unsigned 32 integer in network byte order.
  3487.   // It must be version 2 or 3.
  3488.   function $version(byte) {
  3489.     version = (version << 8) | byte;
  3490.     if (++offset < 4) return $version;
  3491.     if (version >= 2 && version <= 3) {
  3492.       offset = 0;
  3493.       return $num;
  3494.     }
  3495.     throw new Error("Invalid version number " + num);
  3496.   }
  3497.  
  3498.   // The number of objects in this packfile is also stored as an unsigned 32 bit int.
  3499.   function $num(byte) {
  3500.     num = (num << 8) | byte;
  3501.     if (++offset < 4) return $num;
  3502.     offset = 0;
  3503.     emit({version: version, num: num});
  3504.     return $header;
  3505.   }
  3506.  
  3507.   // n-byte type and length (3-bit type, (n-1)*7+4-bit length)
  3508.   // CTTTSSSS
  3509.   // C is continue bit, TTT is type, S+ is length
  3510.   function $header(byte) {
  3511.     if (start === 0) start = position;
  3512.     type = byte >> 4 & 0x07;
  3513.     length = byte & 0x0f;
  3514.     if (byte & 0x80) {
  3515.       offset = 4;
  3516.       return $header2;
  3517.     }
  3518.     return afterHeader();
  3519.   }
  3520.  
  3521.   // Second state in the same header parsing.
  3522.   // CSSSSSSS*
  3523.   function $header2(byte) {
  3524.     length |= (byte & 0x7f) << offset;
  3525.     if (byte & 0x80) {
  3526.       offset += 7;
  3527.       return $header2;
  3528.     }
  3529.     return afterHeader();
  3530.   }
  3531.  
  3532.   // Common helper for finishing tiny and normal headers.
  3533.   function afterHeader() {
  3534.     offset = 0;
  3535.     if (type === 6) {
  3536.       ref = 0;
  3537.       return $ofsDelta;
  3538.     }
  3539.     if (type === 7) {
  3540.       ref = "";
  3541.       return $refDelta;
  3542.     }
  3543.     return $body;
  3544.   }
  3545.  
  3546.   // Big-endian modified base 128 number encoded ref offset
  3547.   function $ofsDelta(byte) {
  3548.     ref = byte & 0x7f;
  3549.     if (byte & 0x80) return $ofsDelta2;
  3550.     return $body;
  3551.   }
  3552.  
  3553.   function $ofsDelta2(byte) {
  3554.     ref = ((ref + 1) << 7) | (byte & 0x7f);
  3555.     if (byte & 0x80) return $ofsDelta2;
  3556.     return $body;
  3557.   }
  3558.  
  3559.   // 20 byte raw sha1 hash for ref
  3560.   function $refDelta(byte) {
  3561.     ref += toHex(byte);
  3562.     if (++offset < 20) return $refDelta;
  3563.     return $body;
  3564.   }
  3565.  
  3566.   // Common helper for generating 2-character hex numbers
  3567.   function toHex(num) {
  3568.     return num < 0x10 ? "0" + num.toString(16) : num.toString(16);
  3569.   }
  3570.  
  3571.   // Common helper for emitting all three object shapes
  3572.   function emitObject() {
  3573.     var item = {
  3574.       type: numToType[type],
  3575.       size: length,
  3576.       body: bops.join(parts),
  3577.       offset: start
  3578.     };
  3579.     if (ref) item.ref = ref;
  3580.     parts.length = 0;
  3581.     start = 0;
  3582.     offset = 0;
  3583.     type = 0;
  3584.     length = 0;
  3585.     ref = null;
  3586.     emit(item);
  3587.   }
  3588.  
  3589.   // Feed the deflated code to the inflate engine
  3590.   function $body(byte, i, chunk) {
  3591.     if (inf.write(byte)) return $body;
  3592.     var buf = inf.flush();
  3593.     if (buf.length !== length) throw new Error("Length mismatch, expected " + length + " got " + buf.length);
  3594.     inf.recycle();
  3595.     if (buf.length) {
  3596.       parts.push(buf);
  3597.     }
  3598.     emitObject();
  3599.     // If this was all the objects, start calculating the sha1sum
  3600.     if (--num) return $header;
  3601.     sha1sum.update(bops.subarray(chunk, 0, i + 1));
  3602.     return $checksum;
  3603.   }
  3604.  
  3605.   // 20 byte checksum
  3606.   function $checksum(byte) {
  3607.     checksum += toHex(byte);
  3608.     if (++offset < 20) return $checksum;
  3609.     var actual = sha1sum.digest();
  3610.     if (checksum !== actual) throw new Error("Checksum mismatch: " + actual + " != " + checksum);
  3611.   }
  3612.  
  3613. }
  3614. };
  3615.  
  3616. defs["node_modules/js-git/lib/inflate.js"] = function (module, exports) {
  3617. var bops = require('node_modules/js-git/node_modules/bops/index.js');
  3618.  
  3619. // Wrapper for proposed new API to inflate:
  3620. //
  3621. //   var inf = inflate();
  3622. //   inf.write(byte) -> more - Write a byte to inflate's state-machine.
  3623. //                             Returns true if more data is expected.
  3624. //   inf.recycle()           - Reset the internal state machine.
  3625. //   inf.flush() -> data     - Flush the output as a binary buffer.
  3626. //
  3627. // This is quite slow, but could be made fast if baked into inflate itself.
  3628. module.exports = function () {
  3629.   var push = inflate(onEmit, onUnused);
  3630.   var more = true;
  3631.   var chunks = [];
  3632.   var b = bops.create(1);
  3633.  
  3634.   return { write: write, recycle: recycle, flush: flush };
  3635.  
  3636.   function write(byte) {
  3637.     b[0] = byte;
  3638.     push(null, b);
  3639.     return more;
  3640.   }
  3641.  
  3642.   function recycle() {
  3643.     push.recycle();
  3644.     more = true;
  3645.   }
  3646.  
  3647.   function flush() {
  3648.     var buffer = bops.join(chunks);
  3649.     chunks.length = 0;
  3650.     return buffer;
  3651.   }
  3652.  
  3653.   function onEmit(err, item) {
  3654.     if (err) throw err;
  3655.     if (item === undefined) {
  3656.       // console.log("onEnd");
  3657.       more = false;
  3658.       return;
  3659.     }
  3660.     chunks.push(item);
  3661.   }
  3662.  
  3663.   function onUnused(chunks) {
  3664.     // console.log("onUnused", chunks);
  3665.     more = false;
  3666.   }
  3667. };
  3668.  
  3669. var MAXBITS = 15
  3670.   , MAXLCODES = 286
  3671.   , MAXDCODES = 30
  3672.   , MAXCODES = (MAXLCODES+MAXDCODES)
  3673.   , FIXLCODES = 288
  3674.  
  3675. var lens = [
  3676.   3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31,
  3677.   35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258
  3678. ]
  3679.  
  3680. var lext = [
  3681.   0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2,
  3682.   3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0
  3683. ]
  3684.  
  3685. var dists = [
  3686.   1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
  3687.   257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
  3688.   8193, 12289, 16385, 24577
  3689. ]
  3690.  
  3691. var dext = [
  3692.   0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6,
  3693.   7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
  3694.   12, 12, 13, 13
  3695. ]
  3696.  
  3697. var order = [
  3698.   16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
  3699. ]
  3700.  
  3701. var WINDOW = 32768
  3702.   , WINDOW_MINUS_ONE = WINDOW - 1
  3703.  
  3704. function inflate(emit, on_unused) {
  3705.   var output = new Uint8Array(WINDOW)
  3706.     , need_input = false
  3707.     , buffer_offset = 0
  3708.     , bytes_read = 0
  3709.     , output_idx = 0
  3710.     , ended = false
  3711.     , state = null
  3712.     , states = []
  3713.     , buffer = []
  3714.     , got = 0
  3715.  
  3716.   // buffer up to 128k "output one" bytes
  3717.   var OUTPUT_ONE_LENGTH = 131070
  3718.     , output_one_offs = OUTPUT_ONE_LENGTH
  3719.     , output_one_buf
  3720.  
  3721.   var bitbuf = 0
  3722.     , bitcnt = 0
  3723.     , is_final = false
  3724.     , fixed_codes
  3725.  
  3726.   var adler_s1 = 1
  3727.     , adler_s2 = 0
  3728.  
  3729.   onread.recycle = function recycle() {
  3730.     var out
  3731.     buffer.length = 0
  3732.     buffer_offset = 0
  3733.     output_idx = 0
  3734.     bitbuf = 0
  3735.     bitcnt = 0
  3736.     states.length = 0
  3737.     is_final = false
  3738.     need_input = false
  3739.     bytes_read = 0
  3740.     output_idx = 0
  3741.     ended = false
  3742.     got = 0
  3743.     adler_s1 = 1
  3744.     adler_s2 = 0
  3745.     output_one_offs = 0
  3746.     become(noop, {}, noop)
  3747.     start_stream_header()
  3748.     // return stream
  3749.   }
  3750.  
  3751.   var bytes_need = 0
  3752.     , bytes_value = []
  3753.  
  3754.   var bits_need = 0
  3755.     , bits_value = []
  3756.  
  3757.   var codes_distcode = null
  3758.     , codes_lencode = null
  3759.     , codes_len = 0
  3760.     , codes_dist = 0
  3761.     , codes_symbol = 0
  3762.  
  3763.   var dynamic_distcode = {symbol: [], count: []}
  3764.     , dynamic_lencode = {symbol: [], count: []}
  3765.     , dynamic_lengths = []
  3766.     , dynamic_nlen = 0
  3767.     , dynamic_ndist = 0
  3768.     , dynamic_ncode = 0
  3769.     , dynamic_index = 0
  3770.     , dynamic_symbol = 0
  3771.     , dynamic_len = 0
  3772.  
  3773.   var decode_huffman = null
  3774.     , decode_len = 0
  3775.     , decode_code = 0
  3776.     , decode_first = 0
  3777.     , decode_count = 0
  3778.     , decode_index = 0
  3779.  
  3780.   var last = null
  3781.  
  3782.   become(noop, {}, noop)
  3783.   start_stream_header()
  3784.  
  3785.   return onread
  3786.  
  3787.   function onread(err, buf) {
  3788.     if(buf === undefined) {
  3789.       return emit(err)
  3790.     }
  3791.  
  3792.     return write(buf)
  3793.   }
  3794.  
  3795.   function noop() {
  3796.  
  3797.   }
  3798.  
  3799.   function call_header() {
  3800.   }
  3801.  
  3802.   function call_bytes(need) {
  3803.     bytes_value.length = 0
  3804.     bytes_need = need
  3805.   }
  3806.  
  3807.   function call_bits(need) {
  3808.     bits_value = 0
  3809.     bits_need = need
  3810.   }
  3811.  
  3812.   function call_codes(distcode, lencode) {
  3813.     codes_len =
  3814.     codes_dist =
  3815.     codes_symbol = 0
  3816.     codes_distcode = distcode
  3817.     codes_lencode = lencode
  3818.   }
  3819.  
  3820.   function call_dynamic() {
  3821.     dynamic_distcode.symbol.length =
  3822.     dynamic_distcode.count.length =
  3823.     dynamic_lencode.symbol.length =
  3824.     dynamic_lencode.count.length =
  3825.     dynamic_lengths.length = 0
  3826.     dynamic_nlen = 0
  3827.     dynamic_ndist = 0
  3828.     dynamic_ncode = 0
  3829.     dynamic_index = 0
  3830.     dynamic_symbol = 0
  3831.     dynamic_len = 0
  3832.   }
  3833.  
  3834.   function call_decode(h) {
  3835.     decode_huffman = h
  3836.     decode_len = 1
  3837.     decode_first =
  3838.     decode_index =
  3839.     decode_code = 0
  3840.   }
  3841.  
  3842.   function write(buf) {
  3843.     buffer.push(buf)
  3844.     got += buf.length
  3845.     if(!ended) {
  3846.       execute()
  3847.     }
  3848.   }
  3849.  
  3850.   function execute() {
  3851.     do {
  3852.       states[0].current()
  3853.     } while(!need_input && !ended)
  3854.  
  3855.     var needed = need_input
  3856.     need_input = false
  3857.   }
  3858.  
  3859.   function start_stream_header() {
  3860.     become(bytes, call_bytes(2), got_stream_header)
  3861.   }
  3862.  
  3863.   function got_stream_header() {
  3864.     var cmf = last[0]
  3865.       , flg = last[1]
  3866.  
  3867.  
  3868.     if((cmf << 8 | flg) % 31 !== 0) {
  3869.       emit(new Error(
  3870.         'failed header check'
  3871.       ))
  3872.       return
  3873.     }
  3874.  
  3875.  
  3876.  
  3877.  
  3878.     if(flg & 32) {
  3879.       return become(bytes, call_bytes(4), on_got_fdict)
  3880.     }
  3881.     return become(bits, call_bits(1), on_got_is_final)
  3882.   }
  3883.  
  3884.  
  3885.  
  3886.  
  3887.   function on_got_fdict() {
  3888.     return become(bits, call_bits(1), on_got_is_final)
  3889.   }
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895.  
  3896.  
  3897.  
  3898.   function on_got_is_final() {
  3899.     is_final = last
  3900.     become(bits, call_bits(2), on_got_type)
  3901.   }
  3902.  
  3903.  
  3904.  
  3905.  
  3906.  
  3907.  
  3908.  
  3909.  
  3910.  
  3911.  
  3912.  
  3913.  
  3914.   function on_got_type() {
  3915.     if(last === 0) {
  3916.       become(bytes, call_bytes(4), on_got_len_nlen)
  3917.       return
  3918.     }
  3919.  
  3920.     if(last === 1) {
  3921.       // `fixed` and `dynamic` blocks both eventually delegate
  3922.       // to the "codes" state -- which reads bits of input, throws
  3923.       // them into a huffman tree, and produces "symbols" of output.
  3924.       fixed_codes = fixed_codes || build_fixed()
  3925.       become(start_codes, call_codes(
  3926.         fixed_codes.distcode
  3927.       , fixed_codes.lencode
  3928.       ), done_with_codes)
  3929.       return
  3930.     }
  3931.  
  3932.     become(start_dynamic, call_dynamic(), done_with_codes)
  3933.     return
  3934.   }
  3935.  
  3936.  
  3937.  
  3938.  
  3939.   function on_got_len_nlen() {
  3940.     var want = last[0] | (last[1] << 8)
  3941.       , nlen = last[2] | (last[3] << 8)
  3942.  
  3943.     if((~nlen & 0xFFFF) !== want) {
  3944.       emit(new Error(
  3945.         'failed len / nlen check'
  3946.       ))
  3947.     }
  3948.  
  3949.     if(!want) {
  3950.       become(bits, call_bits(1), on_got_is_final)
  3951.       return
  3952.     }
  3953.     become(bytes, call_bytes(want), on_got_stored)
  3954.   }
  3955.  
  3956.  
  3957.  
  3958.  
  3959.   function on_got_stored() {
  3960.     output_many(last)
  3961.     if(is_final) {
  3962.       become(bytes, call_bytes(4), on_got_adler)
  3963.       return
  3964.     }
  3965.     become(bits, call_bits(1), on_got_is_final)
  3966.   }
  3967.  
  3968.  
  3969.  
  3970.  
  3971.  
  3972.  
  3973.   function start_dynamic() {
  3974.     become(bits, call_bits(5), on_got_nlen)
  3975.   }
  3976.  
  3977.   function on_got_nlen() {
  3978.     dynamic_nlen = last + 257
  3979.     become(bits, call_bits(5), on_got_ndist)
  3980.   }
  3981.  
  3982.   function on_got_ndist() {
  3983.     dynamic_ndist = last + 1
  3984.     become(bits, call_bits(4), on_got_ncode)
  3985.   }
  3986.  
  3987.   function on_got_ncode() {
  3988.     dynamic_ncode = last + 4
  3989.     if(dynamic_nlen > MAXLCODES || dynamic_ndist > MAXDCODES) {
  3990.       emit(new Error('bad counts'))
  3991.       return
  3992.     }
  3993.  
  3994.     become(bits, call_bits(3), on_got_lengths_part)
  3995.   }
  3996.  
  3997.   function on_got_lengths_part() {
  3998.     dynamic_lengths[order[dynamic_index]] = last
  3999.  
  4000.     ++dynamic_index
  4001.     if(dynamic_index === dynamic_ncode) {
  4002.       for(; dynamic_index < 19; ++dynamic_index) {
  4003.         dynamic_lengths[order[dynamic_index]] = 0
  4004.       }
  4005.  
  4006.       // temporarily construct the `lencode` using the
  4007.       // lengths we've read. we'll actually be using the
  4008.       // symbols produced by throwing bits into the huffman
  4009.       // tree to constuct the `lencode` and `distcode` huffman
  4010.       // trees.
  4011.       construct(dynamic_lencode, dynamic_lengths, 19)
  4012.       dynamic_index = 0
  4013.  
  4014.       become(decode, call_decode(dynamic_lencode), on_got_dynamic_symbol_iter)
  4015.       return
  4016.     }
  4017.     become(bits, call_bits(3), on_got_lengths_part)
  4018.   }
  4019.  
  4020.   function on_got_dynamic_symbol_iter() {
  4021.     dynamic_symbol = last
  4022.  
  4023.     if(dynamic_symbol < 16) {
  4024.       dynamic_lengths[dynamic_index++] = dynamic_symbol
  4025.       do_check()
  4026.       return
  4027.     }
  4028.  
  4029.     dynamic_len = 0
  4030.     if(dynamic_symbol === 16) {
  4031.       become(bits, call_bits(2), on_got_dynamic_symbol_16)
  4032.       return
  4033.     }
  4034.  
  4035.     if(dynamic_symbol === 17) {
  4036.       become(bits, call_bits(3), on_got_dynamic_symbol_17)
  4037.       return
  4038.     }
  4039.  
  4040.     become(bits, call_bits(7), on_got_dynamic_symbol)
  4041.   }
  4042.  
  4043.   function on_got_dynamic_symbol_16() {
  4044.     dynamic_len = dynamic_lengths[dynamic_index - 1]
  4045.     on_got_dynamic_symbol_17()
  4046.   }
  4047.  
  4048.   function on_got_dynamic_symbol_17() {
  4049.     dynamic_symbol = 3 + last
  4050.     do_dynamic_end_loop()
  4051.   }
  4052.  
  4053.   function on_got_dynamic_symbol() {
  4054.     dynamic_symbol = 11 + last
  4055.     do_dynamic_end_loop()
  4056.   }
  4057.  
  4058.   function do_dynamic_end_loop() {
  4059.     if(dynamic_index + dynamic_symbol > dynamic_nlen + dynamic_ndist) {
  4060.       emit(new Error('too many lengths'))
  4061.       return
  4062.     }
  4063.  
  4064.     while(dynamic_symbol--) {
  4065.       dynamic_lengths[dynamic_index++] = dynamic_len
  4066.     }
  4067.  
  4068.     do_check()
  4069.   }
  4070.  
  4071.   function do_check() {
  4072.     if(dynamic_index >= dynamic_nlen + dynamic_ndist) {
  4073.       end_read_dynamic()
  4074.       return
  4075.     }
  4076.     become(decode, call_decode(dynamic_lencode), on_got_dynamic_symbol_iter)
  4077.   }
  4078.  
  4079.   function end_read_dynamic() {
  4080.     // okay, we can finally start reading data out of the stream.
  4081.     construct(dynamic_lencode, dynamic_lengths, dynamic_nlen)
  4082.     construct(dynamic_distcode, dynamic_lengths.slice(dynamic_nlen), dynamic_ndist)
  4083.     become(start_codes, call_codes(
  4084.         dynamic_distcode
  4085.       , dynamic_lencode
  4086.     ), done_with_codes)
  4087.   }
  4088.  
  4089.   function start_codes() {
  4090.     become(decode, call_decode(codes_lencode), on_got_codes_symbol)
  4091.   }
  4092.  
  4093.   function on_got_codes_symbol() {
  4094.     var symbol = codes_symbol = last
  4095.     if(symbol < 0) {
  4096.       emit(new Error('invalid symbol'))
  4097.       return
  4098.     }
  4099.  
  4100.     if(symbol < 256) {
  4101.       output_one(symbol)
  4102.       become(decode, call_decode(codes_lencode), on_got_codes_symbol)
  4103.       return
  4104.     }
  4105.  
  4106.     if(symbol > 256) {
  4107.       symbol = codes_symbol -= 257
  4108.       if(symbol >= 29) {
  4109.         emit(new Error('invalid fixed code'))
  4110.         return
  4111.       }
  4112.  
  4113.       become(bits, call_bits(lext[symbol]), on_got_codes_len)
  4114.       return
  4115.     }
  4116.  
  4117.     if(symbol === 256) {
  4118.       unbecome()
  4119.       return
  4120.     }
  4121.   }
  4122.  
  4123.  
  4124.  
  4125.  
  4126.  
  4127.  
  4128.   function on_got_codes_len() {
  4129.     codes_len = lens[codes_symbol] + last
  4130.     become(decode, call_decode(codes_distcode), on_got_codes_dist_symbol)
  4131.   }
  4132.  
  4133.  
  4134.   function on_got_codes_dist_symbol() {
  4135.     codes_symbol = last
  4136.     if(codes_symbol < 0) {
  4137.       emit(new Error('invalid distance symbol'))
  4138.       return
  4139.     }
  4140.  
  4141.     become(bits, call_bits(dext[codes_symbol]), on_got_codes_dist_dist)
  4142.   }
  4143.  
  4144.   function on_got_codes_dist_dist() {
  4145.     var dist = dists[codes_symbol] + last
  4146.  
  4147.     // Once we have a "distance" and a "length", we start to output bytes.
  4148.     // We reach "dist" back from our current output position to get the byte
  4149.     // we should repeat and output it (thus moving the output window cursor forward).
  4150.     // Two notes:
  4151.     //
  4152.     // 1. Theoretically we could overlap our output and input.
  4153.     // 2. `X % (2^N) == X & (2^N - 1)` with the distinction that
  4154.     //    the result of the bitwise AND won't be negative for the
  4155.     //    range of values we're feeding it. Spare a modulo, spoil the child.
  4156.     while(codes_len--) {
  4157.       output_one(output[(output_idx - dist) & WINDOW_MINUS_ONE])
  4158.     }
  4159.  
  4160.     become(decode, call_decode(codes_lencode), on_got_codes_symbol)
  4161.   }
  4162.  
  4163.   function done_with_codes() {
  4164.     if(is_final) {
  4165.       become(bytes, call_bytes(4), on_got_adler)
  4166.       return
  4167.     }
  4168.     become(bits, call_bits(1), on_got_is_final)
  4169.   }
  4170.  
  4171.  
  4172.  
  4173.  
  4174.   function on_got_adler() {
  4175.     var check_s1 = last[3] | (last[2] << 8)
  4176.       , check_s2 = last[1] | (last[0] << 8)
  4177.  
  4178.     if(check_s2 !== adler_s2 || check_s1 !== adler_s1) {
  4179.       emit(new Error(
  4180.         'bad adler checksum: '+[check_s2, adler_s2, check_s1, adler_s1]
  4181.       ))
  4182.       return
  4183.     }
  4184.  
  4185.     ended = true
  4186.  
  4187.     output_one_recycle()
  4188.  
  4189.     if(on_unused) {
  4190.       on_unused(
  4191.           [bops.subarray(buffer[0], buffer_offset)].concat(buffer.slice(1))
  4192.         , bytes_read
  4193.       )
  4194.     }
  4195.  
  4196.     output_idx = 0
  4197.     ended = true
  4198.     emit()
  4199.   }
  4200.  
  4201.   function decode() {
  4202.     _decode()
  4203.   }
  4204.  
  4205.   function _decode() {
  4206.     if(decode_len > MAXBITS) {
  4207.       emit(new Error('ran out of codes'))
  4208.       return
  4209.     }
  4210.  
  4211.     become(bits, call_bits(1), got_decode_bit)
  4212.   }
  4213.  
  4214.   function got_decode_bit() {
  4215.     decode_code = (decode_code | last) >>> 0
  4216.     decode_count = decode_huffman.count[decode_len]
  4217.     if(decode_code < decode_first + decode_count) {
  4218.       unbecome(decode_huffman.symbol[decode_index + (decode_code - decode_first)])
  4219.       return
  4220.     }
  4221.     decode_index += decode_count
  4222.     decode_first += decode_count
  4223.     decode_first <<= 1
  4224.     decode_code = (decode_code << 1) >>> 0
  4225.     ++decode_len
  4226.     _decode()
  4227.   }
  4228.  
  4229.  
  4230.   function become(fn, s, then) {
  4231.     if(typeof then !== 'function') {
  4232.       throw new Error
  4233.     }
  4234.     states.unshift({
  4235.       current: fn
  4236.     , next: then
  4237.     })
  4238.   }
  4239.  
  4240.   function unbecome(result) {
  4241.     if(states.length > 1) {
  4242.       states[1].current = states[0].next
  4243.     }
  4244.     states.shift()
  4245.     if(!states.length) {
  4246.       ended = true
  4247.  
  4248.       output_one_recycle()
  4249.       if(on_unused) {
  4250.         on_unused(
  4251.             [bops.subarray(buffer[0], buffer_offset)].concat(buffer.slice(1))
  4252.           , bytes_read
  4253.         )
  4254.       }
  4255.       output_idx = 0
  4256.       ended = true
  4257.       emit()
  4258.       // return
  4259.     }
  4260.     else {
  4261.       last = result
  4262.     }
  4263.   }
  4264.  
  4265.   function bits() {
  4266.     var byt
  4267.       , idx
  4268.  
  4269.     idx = 0
  4270.     bits_value = bitbuf
  4271.     while(bitcnt < bits_need) {
  4272.       // we do this to preserve `bits_value` when
  4273.       // "need_input" is tripped.
  4274.       //
  4275.       // fun fact: if we moved that into the `if` statement
  4276.       // below, it would trigger a deoptimization of this (very
  4277.       // hot) function. JITs!
  4278.       bitbuf = bits_value
  4279.       byt = take()
  4280.       if(need_input) {
  4281.         break
  4282.       }
  4283.       ++idx
  4284.       bits_value = (bits_value | (byt << bitcnt)) >>> 0
  4285.       bitcnt += 8
  4286.     }
  4287.  
  4288.     if(!need_input) {
  4289.       bitbuf = bits_value >>> bits_need
  4290.       bitcnt -= bits_need
  4291.       unbecome((bits_value & ((1 << bits_need) - 1)) >>> 0)
  4292.     }
  4293.   }
  4294.  
  4295.  
  4296.  
  4297.   function bytes() {
  4298.     var byte_accum = bytes_value
  4299.       , value
  4300.  
  4301.     while(bytes_need--) {
  4302.       value = take()
  4303.  
  4304.  
  4305.       if(need_input) {
  4306.         bitbuf = bitcnt = 0
  4307.         bytes_need += 1
  4308.         break
  4309.       }
  4310.       byte_accum[byte_accum.length] = value
  4311.     }
  4312.     if(!need_input) {
  4313.       bitcnt = bitbuf = 0
  4314.       unbecome(byte_accum)
  4315.     }
  4316.   }
  4317.  
  4318.  
  4319.  
  4320.   function take() {
  4321.     if(!buffer.length) {
  4322.       need_input = true
  4323.       return
  4324.     }
  4325.  
  4326.     if(buffer_offset === buffer[0].length) {
  4327.       buffer.shift()
  4328.       buffer_offset = 0
  4329.       return take()
  4330.     }
  4331.  
  4332.     ++bytes_read
  4333.  
  4334.     return bitbuf = takebyte()
  4335.   }
  4336.  
  4337.   function takebyte() {
  4338.     return buffer[0][buffer_offset++]
  4339.   }
  4340.  
  4341.  
  4342.  
  4343.   function output_one(val) {
  4344.     adler_s1 = (adler_s1 + val) % 65521
  4345.     adler_s2 = (adler_s2 + adler_s1) % 65521
  4346.     output[output_idx++] = val
  4347.     output_idx &= WINDOW_MINUS_ONE
  4348.     output_one_pool(val)
  4349.   }
  4350.  
  4351.   function output_one_pool(val) {
  4352.     if(output_one_offs === OUTPUT_ONE_LENGTH) {
  4353.       output_one_recycle()
  4354.     }
  4355.  
  4356.     output_one_buf[output_one_offs++] = val
  4357.   }
  4358.  
  4359.   function output_one_recycle() {
  4360.     if(output_one_offs > 0) {
  4361.       if(output_one_buf) {
  4362.         emit(null, bops.subarray(output_one_buf, 0, output_one_offs))
  4363.       } else {
  4364.       }
  4365.       output_one_buf = bops.create(OUTPUT_ONE_LENGTH)
  4366.       output_one_offs = 0
  4367.     }
  4368.   }
  4369.  
  4370.   function output_many(vals) {
  4371.     var len
  4372.       , byt
  4373.       , olen
  4374.  
  4375.     output_one_recycle()
  4376.     for(var i = 0, len = vals.length; i < len; ++i) {
  4377.       byt = vals[i]
  4378.       adler_s1 = (adler_s1 + byt) % 65521
  4379.       adler_s2 = (adler_s2 + adler_s1) % 65521
  4380.       output[output_idx++] = byt
  4381.       output_idx &= WINDOW_MINUS_ONE
  4382.     }
  4383.  
  4384.     emit(null, bops.from(vals))
  4385.   }
  4386. }
  4387.  
  4388. function build_fixed() {
  4389.   var lencnt = []
  4390.     , lensym = []
  4391.     , distcnt = []
  4392.     , distsym = []
  4393.  
  4394.   var lencode = {
  4395.       count: lencnt
  4396.     , symbol: lensym
  4397.   }
  4398.  
  4399.   var distcode = {
  4400.       count: distcnt
  4401.     , symbol: distsym
  4402.   }
  4403.  
  4404.   var lengths = []
  4405.     , symbol
  4406.  
  4407.   for(symbol = 0; symbol < 144; ++symbol) {
  4408.     lengths[symbol] = 8
  4409.   }
  4410.   for(; symbol < 256; ++symbol) {
  4411.     lengths[symbol] = 9
  4412.   }
  4413.   for(; symbol < 280; ++symbol) {
  4414.     lengths[symbol] = 7
  4415.   }
  4416.   for(; symbol < FIXLCODES; ++symbol) {
  4417.     lengths[symbol] = 8
  4418.   }
  4419.   construct(lencode, lengths, FIXLCODES)
  4420.  
  4421.   for(symbol = 0; symbol < MAXDCODES; ++symbol) {
  4422.     lengths[symbol] = 5
  4423.   }
  4424.   construct(distcode, lengths, MAXDCODES)
  4425.   return {lencode: lencode, distcode: distcode}
  4426. }
  4427.  
  4428. function construct(huffman, lengths, num) {
  4429.   var symbol
  4430.     , left
  4431.     , offs
  4432.     , len
  4433.  
  4434.   offs = []
  4435.  
  4436.   for(len = 0; len <= MAXBITS; ++len) {
  4437.     huffman.count[len] = 0
  4438.   }
  4439.  
  4440.   for(symbol = 0; symbol < num; ++symbol) {
  4441.     huffman.count[lengths[symbol]] += 1
  4442.   }
  4443.  
  4444.   if(huffman.count[0] === num) {
  4445.     return
  4446.   }
  4447.  
  4448.   left = 1
  4449.   for(len = 1; len <= MAXBITS; ++len) {
  4450.     left <<= 1
  4451.     left -= huffman.count[len]
  4452.     if(left < 0) {
  4453.       return left
  4454.     }
  4455.   }
  4456.  
  4457.   offs[1] = 0
  4458.   for(len = 1; len < MAXBITS; ++len) {
  4459.     offs[len + 1] = offs[len] + huffman.count[len]
  4460.   }
  4461.  
  4462.   for(symbol = 0; symbol < num; ++symbol) {
  4463.     if(lengths[symbol] !== 0) {
  4464.       huffman.symbol[offs[lengths[symbol]]++] = symbol
  4465.     }
  4466.   }
  4467.  
  4468.   return left
  4469. }
  4470. };
  4471.  
  4472. defs["node_modules/js-git/lib/deflate.js"] = function (module, exports) {
  4473. var zlib = require('zlib');
  4474. module.exports = function deflate(buffer, callback) {
  4475.   return zlib.deflate(buffer, callback);
  4476. };
  4477. // TODO: make this work in the browser too.
  4478. };
  4479.  
  4480. defs["node_modules/js-git/mixins/client.js"] = function (module, exports) {
  4481. var pushToPull = require('node_modules/js-git/node_modules/push-to-pull/transform.js');
  4482. var parse = pushToPull(require('node_modules/js-git/lib/pack-codec.js').decodePack);
  4483. var agent = require('node_modules/js-git/lib/agent.js');
  4484.  
  4485. module.exports = function (repo) {
  4486.   repo.fetchPack = fetchPack;
  4487.   repo.sendPack = sendPack;
  4488. };
  4489.  
  4490. function fetchPack(remote, opts, callback) {
  4491.   if (!callback) return fetchPack.bind(this, remote, opts);
  4492.   var repo = this;
  4493.   var db = repo.db;
  4494.   var refs, branch, queue, ref, hash;
  4495.   return remote.discover(onDiscover);
  4496.  
  4497.   function onDiscover(err, serverRefs, serverCaps) {
  4498.     if (err) return callback(err);
  4499.     refs = serverRefs;
  4500.     opts.caps = processCaps(opts, serverCaps);
  4501.     return processWants(refs, opts.want, onWants);
  4502.   }
  4503.  
  4504.   function onWants(err, wants) {
  4505.     if (err) return callback(err);
  4506.     opts.wants = wants;
  4507.     return remote.fetch(repo, opts, onPackStream);
  4508.   }
  4509.  
  4510.   function onPackStream(err, raw) {
  4511.     if (err) return callback(err);
  4512.     if (!raw) return remote.close(onDone);
  4513.     var packStream = parse(raw);
  4514.     return repo.unpack(packStream, opts, onUnpack);
  4515.   }
  4516.  
  4517.   function onUnpack(err) {
  4518.     if (err) return callback(err);
  4519.     return remote.close(onClose);
  4520.   }
  4521.  
  4522.   function onClose(err) {
  4523.     if (err) return callback(err);
  4524.     queue = Object.keys(refs);
  4525.     return next();
  4526.   }
  4527.  
  4528.   function next(err) {
  4529.     if (err) return callback(err);
  4530.     ref = queue.shift();
  4531.     if (!ref) return repo.setHead(branch, onDone);
  4532.     if (ref === "HEAD" || /{}$/.test(ref)) return next();
  4533.     hash = refs[ref];
  4534.     if (!branch && (hash === refs.HEAD)) branch = ref.substr(11);
  4535.     db.has(hash, onHas);
  4536.   }
  4537.  
  4538.   function onHas(err, has) {
  4539.     if (err) return callback(err);
  4540.     if (!has) return next();
  4541.     return db.set(ref, hash + "\n", next);
  4542.   }
  4543.  
  4544.   function onDone(err) {
  4545.     if (err) return callback(err);
  4546.     return callback(null, refs);
  4547.   }
  4548.  
  4549.   function processCaps(opts, serverCaps) {
  4550.     var caps = [];
  4551.     if (serverCaps["ofs-delta"]) caps.push("ofs-delta");
  4552.     if (serverCaps["thin-pack"]) caps.push("thin-pack");
  4553.     if (opts.includeTag && serverCaps["include-tag"]) caps.push("include-tag");
  4554.     if ((opts.onProgress || opts.onError) &&
  4555.         (serverCaps["side-band-64k"] || serverCaps["side-band"])) {
  4556.       caps.push(serverCaps["side-band-64k"] ? "side-band-64k" : "side-band");
  4557.       if (!opts.onProgress && serverCaps["no-progress"]) {
  4558.         caps.push("no-progress");
  4559.       }
  4560.     }
  4561.     if (serverCaps.agent) caps.push("agent=" + agent);
  4562.     return caps;
  4563.   }
  4564.  
  4565.   function processWants(refs, filter, callback) {
  4566.     if (filter === null || filter === undefined) {
  4567.       return defaultWants(refs, callback);
  4568.     }
  4569.     filter = Array.isArray(filter) ? arrayFilter(filter) :
  4570.       typeof filter === "function" ? filter = filter :
  4571.       wantFilter(filter);
  4572.  
  4573.     var list = Object.keys(refs);
  4574.     var wants = {};
  4575.     var ref, hash;
  4576.     return shift();
  4577.     function shift() {
  4578.       ref = list.shift();
  4579.       if (!ref) return callback(null, Object.keys(wants));
  4580.       hash = refs[ref];
  4581.       repo.resolve(ref, onResolve);
  4582.     }
  4583.     function onResolve(err, oldHash) {
  4584.       // Skip refs we already have
  4585.       if (hash === oldHash) return shift();
  4586.       filter(ref, onFilter);
  4587.     }
  4588.     function onFilter(err, want) {
  4589.       if (err) return callback(err);
  4590.       // Skip refs the user doesn't want
  4591.       if (want) wants[hash] = true;
  4592.       return shift();
  4593.     }
  4594.   }
  4595.  
  4596.   function defaultWants(refs, callback) {
  4597.     return repo.listRefs("refs/heads", onRefs);
  4598.  
  4599.     function onRefs(err, branches) {
  4600.       if (err) return callback(err);
  4601.       var wants = Object.keys(branches);
  4602.       wants.unshift("HEAD");
  4603.       return processWants(refs, wants, callback);
  4604.     }
  4605.   }
  4606.  
  4607. }
  4608.  
  4609. function wantMatch(ref, want) {
  4610.   if (want === "HEAD" || want === null || want === undefined) {
  4611.     return ref === "HEAD";
  4612.   }
  4613.   if (Object.prototype.toString.call(want) === '[object RegExp]') {
  4614.     return want.test(ref);
  4615.   }
  4616.   if (typeof want === "boolean") return want;
  4617.   if (typeof want !== "string") {
  4618.     throw new TypeError("Invalid want type: " + typeof want);
  4619.   }
  4620.   return (/^refs\//.test(ref) && ref === want) ||
  4621.     (ref === "refs/heads/" + want) ||
  4622.     (ref === "refs/tags/" + want);
  4623. }
  4624.  
  4625. function wantFilter(want) {
  4626.   return filter;
  4627.   function filter(ref, callback) {
  4628.     var result;
  4629.     try {
  4630.       result = wantMatch(ref, want);
  4631.     }
  4632.     catch (err) {
  4633.       return callback(err);
  4634.     }
  4635.     return callback(null, result);
  4636.   }
  4637. }
  4638.  
  4639. function arrayFilter(want) {
  4640.   var length = want.length;
  4641.   return filter;
  4642.   function filter(ref, callback) {
  4643.     var result;
  4644.     try {
  4645.       for (var i = 0; i < length; ++i) {
  4646.         result = wantMatch(ref, want[i]);
  4647.         if (result) break;
  4648.       }
  4649.     }
  4650.     catch (err) {
  4651.       return callback(err);
  4652.     }
  4653.     return callback(null, result);
  4654.   }
  4655. }
  4656.  
  4657. function sendPack(remote, opts, callback) {
  4658.   if (!callback) return sendPack.bind(this, remote, opts);
  4659.   throw "TODO: Implement repo.sendPack";
  4660. }
  4661. };
  4662.  
  4663. defs["node_modules/js-git/lib/agent.js"] = function (module, exports) {
  4664. var meta = require('node_modules/js-git/package.json');
  4665. module.exports = meta.name + "/" + meta.version;
  4666. };
  4667.  
  4668. defs["node_modules/js-git/package.json"] = function (module, exports) {
  4669. module.exports = {"name":"js-git","version":"0.6.2","description":"Git Implemented in JavaScript","main":"js-git.js","repository":{"type":"git","url":"git://github.com/creationix/js-git.git"},"devDependencies":{"git-fs-db":"~0.2.0","git-net":"~0.0.4","git-node-platform":"~0.1.4","gen-run":"~0.1.1"},"keywords":["git","js-git"],"author":{"name":"Tim Caswell","email":"[email protected]"},"license":"MIT","bugs":{"url":"https://github.com/creationix/js-git/issues"},"dependencies":{"push-to-pull":"~0.1.0","varint":"0.0.3","bops":"~0.1.0"},"readme":"js-git\n======\n\nGit Implemented in JavaScript.\n\nThis project is very modular and configurable by gluing different components together.\n\nThis repo, `js-git`, is the core implementation of git and consumes various instances of interfaces.  This means that your network and persistance stack is completely pluggable.\n\nIf you're looking for a more pre-packaged system, consider packages like `creationix/git-node` that implement all the abstract interfaces using node.js native APIs.  The `creationix/jsgit` package is an example of a CLI tool that consumes this.\n\nThe main end-user API as exported by this module for working with local repositories is:\n\n## Initialize the library\n\nFirst you create an instance of the library by injecting the platform dependencies.\n\n```js\nvar platform = require('git-node-platform');\nvar jsGit = require('js-git')(platform);\n```\n\n## Wrap a Database\n\nThen you implement the database interface (or more likely use a library to create it for you).\n\n```js\nvar fsDb = require('git-fs-db')(platform);\nvar db = fsDb(\"/path/to/repo.git\");\n```\n\nThe database interface is documented later on.\n\n## Continuables\n\nIn all public async functions you can either pass in a node-style callback last or omit the callback and it will return you a continuable.\n\nThis means you can consume the js-git library using normal ES3 code or if you prefer use [gen-run][] and consume the continuables.\n\nIf the callback is omitted, a continuable is returned.  You must pass a callback into this continuable to actually start the action.\n\n```js\n// Callback mode\njsgit.someAction(arg1, arg2, function (err, result) {\n  ...\n});\n\n// Continuable mode\nvar cont = jsgit.someAction(arg1, arg2);\ncont(function (err, result) {\n  ...\n});\n\n// Continuable mode with gen-run\nvar result = yield jsgit.someAction(arg1, arg2);\n```\n\n### db.get(key, [callback]) -> value\n\nLoad a ref or object from the database.\n\nThe database should assume that keys that are 40-character long hex strings are sha1 hashes.  The value for these will always be binary (`Buffer` in node, `Uint8Array` in browser)\nAll other keys are paths like `refs/heads/master` or `HEAD` and the value is a string.\n\n\n### db.set(key, value, [callback])\n\nSave a value to the database.  Same rules apply about hash keys being binary values and other keys being string values.\n\n### db.has(key, [callback]) -> hasKey?\n\nCheck if a key is in the database\n\n### db.del(key, [callback])\n\nRemove an object or ref from the database.\n\n### db.keys(prefix, [callback]) -> keys\n\nGiven a path prefix, give all the keys.  This is like a readdir if you treat the keys as paths.\n\nFor example, given the keys `refs/heads/master`, `refs/heads/experimental`, `refs/tags/0.1.3` and the prefix `refs/heads/`, the output would be `master` and `experimental`.\n\nA null prefix returns all non hash keys.\n\n### db.init([callback])\n\nInitialize a database.  This is where you db implementation can setup stuff.\n\n### db.clear([callback])\n\nThis is for when the user wants to delete or otherwise reclaim your database's resources.\n\n\n### Wrapping the DataBase\n\nNow that you have a database instance, you can use the jsGit library created above.\n\n```js\nvar repo = jsGit(db);\n```\n\n### repo.load(hash(ish), [callback]) -> git object\n\nLoad a git object from the database.  You can pass in either a hash or a symbolic name like `HEAD` or `refs/tags/v3.1.4`.\n\nThe object will be of the form:\n\n```js\n{\n  type: \"commit\", // Or \"tag\", \"tree\", or \"blob\"\n  body: { ... } // Or an array for tree and a binary value for blob.\n}\n```\n\n### repo.save(object, [callback]) -> hash\n\nSave an object to the database.  This will give you back the hash of the cotent by which you can retrieve the value back.\n\n### repo.loadAs(type, hash, [callback]) -> body\n\nThis convenience wrapper will call `repo.load` for you and then check if the type is what you expected.  If it is, it will return the body directly.  If it's not, it will error.\n\n```js\nvar commit = yield repo.loadAs(\"commit\", \"HEAD\");\nvar tree = yield repo.loadAs(\"tree\", commit.tree);\n```\n\nI'm using yield syntax because it's simpler, you can use callbacks instead if you prefer.\n\n### repo.saveAs(type, body, [callback]) -> hash\n\nAnother convenience wrapper, this time to save objects as a specefic type.  The body must be in the right format.\n\n```js\nvar blobHash = yield repo.saveAs(\"blob\", binaryData);\nvar treeHash = yield repo.saveAs(\"tree\", [\n  { mode: 0100644, name: \"file.dat\", hash: blobHash }\n]);\nvar commitHash = yield repo.saveAs(\"commit\", {\n  tree: treeHash,\n  author: { name: \"Tim Caswell\", email: \"[email protected]\", date: new Date },\n  message: \"Save the blob\"\n});\n```\n\n### repo.remove(hash, [callback])\n\nRemove an object.\n\n### repo.unpack(packFileStream, opts, [callback])\n\nImport a packfile stream (simple-stream format) into the current database.  This is used mostly for clone and fetch operations where the stream comes from a remote repo.\n\n`opts` is a hash of optional configs.\n\n - `opts.onProgress(progress)` - listen to the git progress channel by passing in a event listener.\n - `opts.onError(error)` - same thing, but for the error channel.\n - `opts.deline` - If this is truthy, the progress and error messages will be rechunked to be whole lines.  They usually come jumbled in the internal sidechannel.\n\n### repo.logWalk(hash(ish), [callback]) -> log stream\n\nThis convenience wrapper creates a readable stream of the history sorted by author date.\n\nIf you want full history, pass in `HEAD` for the hash.\n\n### repo.treeWalk(hash(ish), [callback]) -> file stream\n\nThis helper will return a stream of files suitable for traversing a file tree as a linear stream.  The hash can be a ref to a commit, a commit hash or a tree hash directly.\n\n### repo.walk(seed, scan, loadKey, compare) -> stream\n\nThis is the generic helper that `logWalk` and `treeWalk` use.  See `js-git.js` source for usage.\n\n### repo.resolveHashish(hashish, [callback]) -> hash\n\nResolve a ref, branch, or tag to a real hash.\n\n### repo.updateHead(hash, [callback])\n\nUpdate whatever branch `HEAD` is pointing to so that it points to `hash`.\n\nYou'll usually want to do this after creating a new commint in the HEAD branch.\n\n### repo.getHead([callback]) -> ref name\n\nRead the current active branch.\n\n### repo.setHead(ref, [callback])\n\nSet the current active branch.\n\n### repo.fetch(remote, opts, [callback])\n\nConvenience wrapper that fetches from a remote instance and calls `repo.unpack` with the resulting packfile stream for you.\n\n## Related Packages\n\nBeing that js-git is so modular, here is a list of the most relevent modules that work with js-git:\n\n - <https://github.com/creationix/git-net> - A generic remote protocol implementation that wraps the platform interfaces and consumes urls.\n - Example Applications\n   - <https://github.com/creationix/git-browser> - A multi-platform GUI program that clones and browses git repos.\n   - <https://github.com/creationix/jsgit> - An example of using js-git in node.  This is a CLI tool.\n     - <https://github.com/creationix/git-node> - A packaged version of js-git made for node.js\n - Platform Helpers\n   - <https://github.com/creationix/git-http> - A git-http platform interface adapter that wraps git-tcp platform instances.\n   - <https://github.com/creationix/git-node-platform> - Just the platform interface for using js-git on node.js.\n   - <https://github.com/creationix/git-sha1> - A pure-js implementation of the sha1 part of the platform interface.\n   - <https://github.com/creationix/git-web-platform> - An implementation of js-git platform for browsers.\n   - <https://github.com/creationix/websocket-tcp-client> - An implementation of the git-tcp interface that consumes a websocket to tcp proxy server.\n   - <https://github.com/creationix/git-zlib> - A pure-js implementation of the zlib parts of the platform interface.\n - Storage Backends\n   - <https://github.com/creationix/git-fs-db> - A database interface adapter that wraps a fs interface.\n   - <https://github.com/creationix/git-localdb> - A git-db implementation based on `localStorage`.\n   - <https://github.com/creationix/git-memdb> - A git-db implementation that stores data in ram for quick testing.\n   - <https://github.com/aaronpowell/git-indexeddb> - A git-db implementation cased on `indexedDB`.\n\n[gen-run]: https://github.com/creationix/gen-run\n","readmeFilename":"README.md","homepage":"https://github.com/creationix/js-git","_id":"[email protected]","_from":"js-git@"};
  4670. };
  4671.  
  4672. defs["node_modules/js-git/mixins/server.js"] = function (module, exports) {
  4673. var parallel = require('node_modules/js-git/lib/parallel.js');
  4674. var map = require('node_modules/js-git/lib/map.js');
  4675. var each = require('node_modules/js-git/lib/each.js');
  4676.  
  4677. var bops = {
  4678.   join: require('node_modules/js-git/node_modules/bops/typedarray/join.js')
  4679. };
  4680.  
  4681. module.exports = function (repo) {
  4682.   repo.uploadPack = uploadPack;
  4683.   repo.receivePack = receivePack;
  4684. };
  4685.  
  4686. function uploadPack(remote, opts, callback) {
  4687.   if (!callback) return uploadPack.bind(this, remote, opts);
  4688.   var repo = this, refs, wants = {}, haves = {}, clientCaps = {};
  4689.   var packQueue = [];
  4690.   var queueBytes = 0;
  4691.   var queueLimit = 0;
  4692.   return parallel({
  4693.     head: repo.getHead(),
  4694.     refs: getRefs()
  4695.   }, onHeadRef);
  4696.  
  4697.   // The peeled value of a ref (that is "ref^{}") MUST be immediately after
  4698.   // the ref itself, if presented. A conforming server MUST peel the ref if
  4699.   // it’s an annotated tag.
  4700.   function getRefs(callback) {
  4701.     if (!callback) return getRefs;
  4702.     var refs;
  4703.     repo.listRefs(null, onRefs);
  4704.  
  4705.     function onRefs(err, result) {
  4706.       if (err) return callback(err);
  4707.       refs = result;
  4708.       parallel(map(refs, function (hash) {
  4709.         return repo.load(hash);
  4710.       }), onValues);
  4711.     }
  4712.  
  4713.     function onValues(err, values) {
  4714.       each(values, function (value, name) {
  4715.         if (value.type !== "tag") return;
  4716.         refs[name + "^{}"] = value.body.object;
  4717.       });
  4718.       callback(null, refs);
  4719.     }
  4720.   }
  4721.  
  4722.   function onHeadRef(err, result) {
  4723.     if (err) return callback(err);
  4724.     var head = result.head;
  4725.     refs = result.refs;
  4726.  
  4727.     // The returned response is a pkt-line stream describing each ref and its
  4728.     // current value. The stream MUST be sorted by name according to the C
  4729.     // locale ordering.
  4730.     var keys = Object.keys(refs).sort();
  4731.     var lines = keys.map(function (ref) {
  4732.       return refs[ref] + " " + ref;
  4733.     });
  4734.  
  4735.     // If HEAD is a valid ref, HEAD MUST appear as the first advertised ref.
  4736.     // If HEAD is not a valid ref, HEAD MUST NOT appear in the advertisement
  4737.     // list at all, but other refs may still appear.
  4738.     if (head) lines.unshift(refs[head] + " HEAD");
  4739.  
  4740.     // The stream MUST include capability declarations behind a NUL on the
  4741.     // first ref.
  4742.     // TODO: add "multi_ack" once it's implemented
  4743.     // TODO: add "multi_ack_detailed" once it's implemented
  4744.     // TODO: add "shallow" once it's implemented
  4745.     // TODO: add "include-tag" once it's implemented
  4746.     // TODO: add "thin-pack" once it's implemented
  4747.     lines[0] += "\0no-progress side-band side-band-64k ofs-delta";
  4748.  
  4749.     // Server SHOULD terminate each non-flush line using LF ("\n") terminator;
  4750.     // client MUST NOT complain if there is no terminator.
  4751.     lines.forEach(function (line) {
  4752.       remote.write(line, null);
  4753.     });
  4754.  
  4755.     remote.write(null, null);
  4756.     remote.read(onWant);
  4757.   }
  4758.  
  4759.   function onWant(err, line) {
  4760.     if (line === undefined) return callback(err);
  4761.     if (line === null) {
  4762.       return remote.read(onHave);
  4763.     }
  4764.     var match = line.match(/^want ([0-9a-f]{40})(?: (.+))?\n?$/);
  4765.     if (!match) {
  4766.       return callback(new Error("Invalid want: " + line));
  4767.     }
  4768.     var hash = match[1];
  4769.     if (match[2]) clientCaps = parseCaps(match[2]);
  4770.     wants[hash] = true;
  4771.     remote.read(onWant);
  4772.   }
  4773.  
  4774.   function onHave(err, line) {
  4775.     if (line === undefined) return callback(err);
  4776.     var match = line.match(/^(done|have)(?: ([0-9a-f]{40}))?\n?$/);
  4777.     if (!match) {
  4778.       return callback(new Error("Unexpected have line: " + line));
  4779.     }
  4780.     if (match[1] === "have") {
  4781.       haves[match[2]] = true;
  4782.       return remote.read(onHave);
  4783.     }
  4784.     if (Object.keys(haves).length) {
  4785.       throw new Error("TODO: handle haves");
  4786.     }
  4787.     remote.write("NAK\n", null);
  4788.     walkRepo(repo, wants, haves, onHashes);
  4789.   }
  4790.  
  4791.   function onHashes(err, hashes) {
  4792.     if (err) return callback(err);
  4793.     if (clientCaps["side-band-64k"]) queueLimit = 65519;
  4794.     else if (clientCaps["size-band"]) queueLimit = 999;
  4795.     repo.pack(hashes, opts, onPack);
  4796.   }
  4797.  
  4798.   function flush(callback) {
  4799.     if (!queueBytes) return callback();
  4800.     var chunk = bops.join(packQueue, queueBytes);
  4801.     packQueue.length = 0;
  4802.     queueBytes = 0;
  4803.     remote.write(["pack", chunk], callback);
  4804.   }
  4805.  
  4806.   function onPack(err, packStream) {
  4807.     if (err) return callback(err);
  4808.     onWrite();
  4809.  
  4810.     function onRead(err, chunk) {
  4811.       if (err) return callback(err);
  4812.       if (chunk === undefined) return flush(onFlush);
  4813.       if (!queueLimit) {
  4814.         return remote.write(chunk, onWrite);
  4815.       }
  4816.       var length = chunk.length;
  4817.       if (queueBytes + length <= queueLimit) {
  4818.         packQueue.push(chunk);
  4819.         queueBytes += length;
  4820.         return onWrite();
  4821.       }
  4822.       if (queueBytes) {
  4823.         flush(function (err) {
  4824.           if (err) return callback(err);
  4825.           return onRead(null, chunk);
  4826.         });
  4827.       }
  4828.       remote.write(["pack", bops.subarray(chunk, 0, queueLimit)], function (err) {
  4829.         if (err) return callback(err);
  4830.         return onRead(null, bops.subarray(chunk, queueLimit));
  4831.       });
  4832.     }
  4833.     function onWrite(err) {
  4834.       if (err) return callback(err);
  4835.       packStream.read(onRead);
  4836.     }
  4837.   }
  4838.  
  4839.   function onFlush(err) {
  4840.     if (err) return callback(err);
  4841.     if (queueLimit) remote.write(null, callback);
  4842.     else callback();
  4843.   }
  4844.  
  4845. }
  4846.  
  4847. function receivePack(remote, opts, callback) {
  4848.   if (!callback) return receivePack.bind(this, remote, opts);
  4849.   var clientCaps = {}, changes = [];
  4850.   var repo = this;
  4851.   this.listRefs(null, function (err, refs) {
  4852.     if (err) return callback(err);
  4853.     Object.keys(refs).forEach(function (ref, i) {
  4854.       var hash = refs[ref];
  4855.       var line = hash + " " + ref;
  4856.       // TODO: Implement report-status below and add here
  4857.       if (!i) line += "\0delete-refs ofs-delta";
  4858.       remote.write(line, null);
  4859.     });
  4860.     remote.write(null, null);
  4861.     remote.read(onLine);
  4862.   });
  4863.  
  4864.   function onLine(err, line) {
  4865.     if (err) return callback(err);
  4866.     if (line === null) {
  4867.       if (changes.length) return repo.unpack(remote, opts, onUnpack);
  4868.       return callback(null, changes);
  4869.     }
  4870.     var match = line.match(/^([0-9a-f]{40}) ([0-9a-f]{40}) ([^ ]+)(?: (.+))?\n?$/);
  4871.     changes.push({
  4872.       oldHash: match[1],
  4873.       newHash: match[2],
  4874.       ref: match[3]
  4875.     });
  4876.     if (match[4]) clientCaps = parseCaps(match[4]);
  4877.     remote.read(onLine);
  4878.   }
  4879.  
  4880.   function onUnpack(err) {
  4881.     if (err) return callback(err);
  4882.     var i = 0, change;
  4883.     next();
  4884.     function next(err) {
  4885.       if (err) return callback(err);
  4886.       change = changes[i++];
  4887.       if (!change) return callback(err, changes);
  4888.       if (change.oldHash === "0000000000000000000000000000000000000000") {
  4889.         return repo.createRef(change.ref, change.newHash, next);
  4890.       }
  4891.       if (change.newHash === "0000000000000000000000000000000000000000") {
  4892.         return repo.deleteRef(change.ref, next);
  4893.       }
  4894.       return repo.updateRef(change.ref, change.newHash, next);
  4895.     }
  4896.   }
  4897. }
  4898.  
  4899. function parseCaps(line) {
  4900.   var caps = {};
  4901.   line.split(" ").map(function (cap) {
  4902.     var pair = cap.split("=");
  4903.     caps[pair[0]] = pair[1] || true;
  4904.   });
  4905.   return caps;
  4906. }
  4907.  
  4908. // Calculate a list of hashes to be included in a pack file based on have and want lists.
  4909. //
  4910. function walkRepo(repo, wants, haves, callback) {
  4911.   var hashes = {};
  4912.   var done = false;
  4913.   var left = 0;
  4914.  
  4915.   function onDone(err) {
  4916.     if (done) return;
  4917.     done = true;
  4918.     return callback(err, Object.keys(hashes));
  4919.   }
  4920.  
  4921.   var keys = Object.keys(wants);
  4922.   if (!keys.length) return onDone();
  4923.   keys.forEach(walkCommit);
  4924.  
  4925.   function walkCommit(hash) {
  4926.     if (done) return;
  4927.     if (hash in hashes || hash in haves) return;
  4928.     hashes[hash] = true;
  4929.     left++;
  4930.     repo.loadAs("commit", hash, function (err, commit) {
  4931.       if (done) return;
  4932.       if (err) return onDone(err);
  4933.       if (!commit) return onDone(new Error("Missing Commit: " + hash));
  4934.       commit.parents.forEach(walkCommit);
  4935.       walkTree(commit.tree);
  4936.       if (!--left) return onDone();
  4937.     });
  4938.   }
  4939.  
  4940.   function walkTree(hash) {
  4941.     if (done) return;
  4942.     if (hash in hashes || hash in haves) return;
  4943.     hashes[hash] = true;
  4944.     left++;
  4945.     repo.loadAs("tree", hash, function (err, tree) {
  4946.       if (done) return;
  4947.       if (err) return onDone(err);
  4948.       if (tree === undefined) return onDone(new Error("Missing tree: " + hash));
  4949.       Object.keys(tree).forEach(function (name) {
  4950.         if (done) return;
  4951.         var item = tree[name];
  4952.         if (item.mode === 040000) walkTree(item.hash);
  4953.         else {
  4954.           if (item.hash in hashes || item.hash in haves) return;
  4955.           hashes[item.hash] = true;
  4956.         }
  4957.       });
  4958.       if (!--left) return onDone();
  4959.     });
  4960.   }
  4961. }
  4962. };
  4963.  
  4964. defs["node_modules/js-git/lib/parallel.js"] = function (module, exports) {
  4965. module.exports = parallel;
  4966.  
  4967. // Run several continuables in parallel.  The results are stored in the same
  4968. // shape as the input continuables (array or object).
  4969. // Returns a new continuable or accepts a callback.
  4970. // This will bail on the first error and ignore all others after it.
  4971. function parallel(commands, callback) {
  4972.   if (!callback) return parallel.bind(this, commands);
  4973.   var results, length, left, i, done;
  4974.  
  4975.   // Handle array shapes
  4976.   if (Array.isArray(commands)) {
  4977.     left = length = commands.length;
  4978.     results = new Array(left);
  4979.     for (i = 0; i < length; i++) {
  4980.       run(i, commands[i]);
  4981.     }
  4982.   }
  4983.  
  4984.   // Otherwise assume it's an object.
  4985.   else {
  4986.     var keys = Object.keys(commands);
  4987.     left = length = keys.length;
  4988.     results = {};
  4989.     for (i = 0; i < length; i++) {
  4990.       var key = keys[i];
  4991.       run(key, commands[key]);
  4992.     }
  4993.   }
  4994.  
  4995.   // Common logic for both
  4996.   function run(key, command) {
  4997.     command(function (err, result) {
  4998.       if (done) return;
  4999.       if (err) {
  5000.         done = true;
  5001.         return callback(err);
  5002.       }
  5003.       results[key] = result;
  5004.       if (--left) return;
  5005.       done = true;
  5006.       callback(null, results);
  5007.     });
  5008.   }
  5009. }
  5010. };
  5011.  
  5012. defs["node_modules/js-git/lib/map.js"] = function (module, exports) {
  5013. module.exports = map;
  5014.  
  5015. // A functional map that works on both arrays and objects
  5016. // The returned object has the same shape as the original, but values mapped.
  5017. function map(obj, fn) {
  5018.   if (Array.isArray(obj)) return obj.map(fn);
  5019.   var result = {};
  5020.   var keys = Object.keys(obj);
  5021.   for (var i = 0, l = keys.length; i < l; i++) {
  5022.     var key = keys[i];
  5023.     result[key] = fn(obj[key], key, obj);
  5024.   }
  5025.   return result;
  5026. }
  5027. };
  5028.  
  5029. defs["node_modules/js-git/lib/each.js"] = function (module, exports) {
  5030. module.exports = each;
  5031.  
  5032. // A functional forEach that works on both arrays and objects
  5033. function each(obj, fn) {
  5034.   if (Array.isArray(obj)) return obj.forEach(fn);
  5035.   var keys = Object.keys(obj);
  5036.   for (var i = 0, l = keys.length; i < l; i++) {
  5037.     var key = keys[i];
  5038.     fn(obj[key], key, obj);
  5039.   }
  5040. }
  5041. };
  5042.  
  5043. defs["node_modules/git-net/remote.js"] = function (module, exports) {
  5044. var urlParse = require('node_modules/git-net/url-parse.js');
  5045. module.exports = function (platform) {
  5046.   var tcp, http, ws, ssh;
  5047.   return processUrl;
  5048.   function processUrl(url) {
  5049.     var opts = urlParse(url);
  5050.     if (opts.protocol === "git:") {
  5051.       if (!platform.tcp) throw new Error("Platform does not support git: urls");
  5052.       tcp = tcp || require('node_modules/git-net/tcp.js')(platform);
  5053.       return tcp(opts);
  5054.     }
  5055.     if (opts.protocol === "http:" || opts.protocol === "https:") {
  5056.       if (!platform.http) throw new Error("Platform does not support http(s): urls");
  5057.       http = http || require('node_modules/git-net/smart-http.js')(platform);
  5058.       return http(opts);
  5059.     }
  5060.     if (opts.protocol === "ws:" || opts.protocol === "wss:") {
  5061.       if (!platform.ws) throw new Error("Platform does not support ws(s): urls");
  5062.       ws = ws || require('node_modules/git-net/ws.js')(platform);
  5063.       return ws(opts);
  5064.     }
  5065.     if (opts.protocol === "ssh:") {
  5066.       if (!platform.ssh) throw new Error("Platform does not support ssh: urls");
  5067.       ssh = ssh || require('node_modules/git-net/ssh.js')(platform);
  5068.       return ssh(opts);
  5069.     }
  5070.     throw new Error("Unknown protocol " + opts.protocol);
  5071.   }
  5072. };
  5073. };
  5074.  
  5075. defs["node_modules/git-net/url-parse.js"] = function (module, exports) {
  5076. module.exports = urlParse;
  5077.  
  5078. function urlParse(href) {
  5079.   var protocol, username, password, hostname, port, pathname, search, hash;
  5080.   var match, host, path;
  5081.   // Match URL style remotes
  5082.   if (match = href.match(/^(?:(wss?:|https?:|git:|ssh:)\/\/)([^\/]+)([^:]+)$/)) {
  5083.     protocol = match[1],
  5084.     host = match[2];
  5085.     path = match[3];
  5086.     match = host.match(/^(?:([^@:]+)(?::([^@]+))?@)?([^@:]+)(?::([0-9]+))?$/);
  5087.     username = match[1];
  5088.     password = match[2];
  5089.     hostname = match[3];
  5090.     port = match[4];
  5091.     match = path.match(/^([^?]*)(\?[^#]*)?(#.*)?$/);
  5092.     pathname = match[1];
  5093.     if (protocol === "ssh:") pathname = pathname.substr(1);
  5094.     search = match[2];
  5095.     hash = match[3];
  5096.   }
  5097.   // Match scp style ssh remotes
  5098.   else if (match = href.match(/^(?:([^@]+)@)?([^:\/]+)([:\/][^:\/][^:]+)$/)) {
  5099.     protocol = "ssh:";
  5100.     username = match[1];
  5101.     host = hostname = match[2];
  5102.     path = pathname = match[3];
  5103.     if (pathname[0] === ":") pathname = pathname.substr(1);
  5104.   }
  5105.   else {
  5106.     throw new Error("Uknown URL format: " + href);
  5107.   }
  5108.  
  5109.   if (port) port = parseInt(port, 10);
  5110.   else if (protocol === "http:" || protocol === "ws:") port = 80;
  5111.   else if (protocol === "https:" || protocol === "wss:") port = 443;
  5112.   else if (protocol === "ssh:") port = 22;
  5113.   else if (protocol === "git:") port = 9418;
  5114.  
  5115.   var opt = {
  5116.     href: href,
  5117.     protocol: protocol
  5118.   };
  5119.   if (username) {
  5120.     opt.username = username;
  5121.     if (password) {
  5122.       opt.password = password;
  5123.       opt.auth = username + ":" + password;
  5124.     }
  5125.     else {
  5126.       opt.auth = username;
  5127.     }
  5128.   }
  5129.   opt.host = host;
  5130.   opt.hostname = hostname;
  5131.   opt.port = port;
  5132.   opt.path = path;
  5133.   opt.pathname = pathname;
  5134.   if (search) opt.search = search;
  5135.   if (hash) opt.hash = hash;
  5136.  
  5137.   return opt;
  5138. }
  5139. };
  5140.  
  5141. defs["node_modules/git-net/tcp.js"] = function (module, exports) {
  5142. module.exports = function (platform) {
  5143.   var writable = require('node_modules/git-net/writable.js');
  5144.   var sharedFetch = require('node_modules/git-net/fetch.js');
  5145.   var sharedDiscover = require('node_modules/git-net/discover.js');
  5146.   var pushToPull = require('node_modules/git-net/node_modules/push-to-pull/transform.js');
  5147.   var pktLine = require('node_modules/git-net/pkt-line.js')(platform);
  5148.   var framer = pushToPull(pktLine.framer);
  5149.   var deframer = pushToPull(pktLine.deframer);
  5150.   var tcp = platform.tcp;
  5151.   var trace = platform.trace;
  5152.  
  5153.   // opts.hostname - host to connect to (github.com)
  5154.   // opts.pathname - path to repo (/creationix/conquest.git)
  5155.   // opts.port - override default port (9418)
  5156.   return function (opts) {
  5157.  
  5158.     var connection;
  5159.  
  5160.     opts.discover = discover;
  5161.     opts.fetch = fetch;
  5162.     opts.close = closeConnection;
  5163.     return opts;
  5164.  
  5165.     function connect(callback) {
  5166.       return tcp.connect(opts.port, opts.hostname, function (err, socket) {
  5167.         if (err) return callback(err);
  5168.         var input = deframer(socket);
  5169.         if (trace) input = trace("input", input);
  5170.  
  5171.         var output = writable(input.abort);
  5172.         connection = {
  5173.           read: input.read,
  5174.           abort: input.abort,
  5175.           write: output
  5176.         };
  5177.         if (trace) output = trace("output", output);
  5178.         output = framer(output);
  5179.         socket.sink(output)(function (err) {
  5180.           if (err) console.error(err.stack || err);
  5181.           // TODO: handle this better somehow
  5182.           // maybe allow writable streams
  5183.         });
  5184.         callback();
  5185.       });
  5186.     }
  5187.  
  5188.     // Send initial git-upload-pack request
  5189.     // outputs refs and caps
  5190.     function discover(callback) {
  5191.       if (!callback) return discover.bind(this);
  5192.       if (!connection) {
  5193.         return connect(function (err) {
  5194.           if (err) return callback(err);
  5195.           return discover(callback);
  5196.         });
  5197.       }
  5198.       connection.write("git-upload-pack " + opts.pathname + "\0host=" + opts.hostname + "\0");
  5199.       sharedDiscover(connection, callback);
  5200.     }
  5201.  
  5202.     function fetch(repo, opts, callback) {
  5203.       if (!callback) return fetch.bind(this, repo, opts);
  5204.       if (!connection) {
  5205.         return callback(new Error("Please connect before fetching"));
  5206.       }
  5207.       return sharedFetch(connection, repo, opts, callback);
  5208.     }
  5209.  
  5210.     function closeConnection(callback) {
  5211.       if (!callback) return closeConnection.bind(this);
  5212.       connection.write();
  5213.       callback();
  5214.     }
  5215.   };
  5216. };
  5217. };
  5218.  
  5219. defs["node_modules/git-net/fetch.js"] = function (module, exports) {
  5220. var deline = require('node_modules/git-net/deline.js');
  5221. module.exports = fetch;
  5222. function fetch(socket, repo, opts, callback) {
  5223.  
  5224.   var read = socket.read,
  5225.       write = socket.write,
  5226.       abort = socket.abort;
  5227.   var onProgress = opts.onProgress,
  5228.       onError = opts.onError,
  5229.       wants = opts.wants,
  5230.       depth = opts.depth,
  5231.       caps = opts.caps;
  5232.   var cb;
  5233.  
  5234.   if (opts.deline) {
  5235.     if (onProgress) onProgress = deline(onProgress);
  5236.     if (onError) onError = deline(onError);
  5237.   }
  5238.  
  5239.   if (!wants.length) {
  5240.     write(null);
  5241.     write("done\n");
  5242.     return callback();
  5243.   }
  5244.  
  5245.   return repo.listRefs("refs", onRefs);
  5246.  
  5247.   function onRefs(err, refs) {
  5248.     if (err) return callback(err);
  5249.  
  5250.     // want-list
  5251.     for (var i = 0, l = wants.length; i < l; ++i) {
  5252.       write("want " + wants[i] + (i === 0 ? " " + caps.join(" ") : "") + "\n");
  5253.     }
  5254.     if (depth) {
  5255.       write("deepen " + depth + "\n");
  5256.     }
  5257.     write(null);
  5258.  
  5259.     // have-list
  5260.     for (var ref in refs) {
  5261.       write("have " + refs[ref] + "\n");
  5262.     }
  5263.  
  5264.     // compute-end
  5265.     write("done\n");
  5266.     return read(onResponse);
  5267.   }
  5268.  
  5269.   function onResponse(err, resp) {
  5270.     if (err) return callback(err);
  5271.     if (resp === undefined) return callback(new Error("Server disconnected"));
  5272.     if (resp === null) return read(onResponse);
  5273.     var match = resp.match(/^([^ \n]*)(?: (.*))?/);
  5274.     var command = match[1];
  5275.     var value = match[2];
  5276.     if (command === "shallow") {
  5277.       return repo.createRef("shallow", value, onShallow);
  5278.     }
  5279.     if (command === "NAK" || command === "ACK") {
  5280.       return callback(null, { read: packRead, abort: abort });
  5281.     }
  5282.     return callback(new Error("Unknown command " + command + " " + value));
  5283.   }
  5284.  
  5285.   function onShallow(err) {
  5286.     if (err) return callback(err);
  5287.     return read(onResponse);
  5288.   }
  5289.  
  5290.   function packRead(callback) {
  5291.     if (cb) return callback(new Error("Only one read at a time"));
  5292.     cb = callback;
  5293.     return read(onItem);
  5294.   }
  5295.  
  5296.   function onItem(err, item) {
  5297.     var callback = cb;
  5298.     if (item === undefined) {
  5299.       cb = null;
  5300.       return callback(err);
  5301.     }
  5302.     if (item) {
  5303.       if (item.progress) {
  5304.         if (onProgress) onProgress(item.progress);
  5305.         return read(onItem);
  5306.       }
  5307.       if (item.error) {
  5308.         if (onError) onError(item.error);
  5309.         return read(onItem);
  5310.       }
  5311.     }
  5312.     if (!item) return read(onItem);
  5313.     cb = null;
  5314.     return callback(null, item);
  5315.   }
  5316. }
  5317. };
  5318.  
  5319. defs["node_modules/git-net/deline.js"] = function (module, exports) {
  5320. module.exports = function deline(emit) {
  5321.   var buffer = "";
  5322.   return function (chunk) {
  5323.     var start = 0;
  5324.     for (var i = 0, l = chunk.length; i < l; ++i) {
  5325.       var c = chunk[i];
  5326.       if (c === "\r" || c === "\n") {
  5327.         buffer += chunk.substr(start, i - start + 1);
  5328.         start = i + 1;
  5329.         emit(buffer);
  5330.         buffer = "";
  5331.       }
  5332.     }
  5333.     buffer += chunk.substr(start);
  5334.   };
  5335. };
  5336. };
  5337.  
  5338. defs["node_modules/git-net/discover.js"] = function (module, exports) {
  5339. module.exports = discover;
  5340. function discover(socket, callback) {
  5341.   var read = socket.read;
  5342.  
  5343.   var refs = {};
  5344.   var caps = null;
  5345.  
  5346.   read(onLine);
  5347.  
  5348.   function onLine(err, line) {
  5349.     if (err) return callback(err);
  5350.     if (/^ERR \n/.test(line)) {
  5351.       return callback(new Error(line.substr(5).trim()));
  5352.     }
  5353.     if (line === null) {
  5354.       return callback(null, refs, caps);
  5355.     }
  5356.     line = line.trim();
  5357.     if (!caps) line = pullCaps(line);
  5358.     var index = line.indexOf(" ");
  5359.     refs[line.substr(index + 1)] = line.substr(0, index);
  5360.     read(onLine);
  5361.   }
  5362.  
  5363.   function pullCaps(line) {
  5364.     var index = line.indexOf("\0");
  5365.     caps = {};
  5366.     line.substr(index + 1).split(" ").map(function (cap) {
  5367.       var pair = cap.split("=");
  5368.       caps[pair[0]] = pair[1] || true;
  5369.     });
  5370.     return line.substr(0, index);
  5371.   }
  5372. }
  5373. };
  5374.  
  5375. defs["node_modules/git-net/node_modules/push-to-pull/transform.js"] = function (module, exports) {
  5376. // input push-filter: (emit) -> emit
  5377. // output is simple-stream pull-filter: (stream) -> stream
  5378. module.exports = pushToPull;
  5379. function pushToPull(parser) {
  5380.   return function (stream) {
  5381.  
  5382.     var write = parser(onData);
  5383.     var cb = null;
  5384.     var queue = [];
  5385.      
  5386.     return { read: read, abort: stream.abort };
  5387.    
  5388.     function read(callback) {
  5389.       if (queue.length) return callback(null, queue.shift());
  5390.       if (cb) return callback(new Error("Only one read at a time."));
  5391.       cb = callback;
  5392.       stream.read(onRead);
  5393.      
  5394.     }
  5395.  
  5396.     function onRead(err, item) {
  5397.       var callback = cb;
  5398.       cb = null;
  5399.       if (err) return callback(err);
  5400.       try {
  5401.         write(item);
  5402.       }
  5403.       catch (err) {
  5404.         return callback(err);
  5405.       }
  5406.       return read(callback);
  5407.     }
  5408.  
  5409.     function onData(item) {
  5410.       queue.push(item);
  5411.     }
  5412.  
  5413.   };
  5414. }
  5415. };
  5416.  
  5417. defs["node_modules/git-net/pkt-line.js"] = function (module, exports) {
  5418. module.exports = function (platform) {
  5419.   var bops = platform.bops;
  5420.   var PACK = bops.from("PACK");
  5421.  
  5422.   return {
  5423.     deframer: deframer,
  5424.     framer: framer
  5425.   };
  5426.  
  5427.   function deframer(emit) {
  5428.     var state = 0;
  5429.     var offset = 4;
  5430.     var length = 0;
  5431.     var data;
  5432.  
  5433.     return function (item) {
  5434.  
  5435.       // Forward the EOS marker
  5436.       if (item === undefined) return emit();
  5437.  
  5438.       // Once we're in pack mode, everything goes straight through
  5439.       if (state === 3) return emit(item);
  5440.  
  5441.       // Otherwise parse the data using a state machine.
  5442.       for (var i = 0, l = item.length; i < l; i++) {
  5443.         var byte = item[i];
  5444.         if (state === 0) {
  5445.           var val = fromHexChar(byte);
  5446.           if (val === -1) {
  5447.             if (byte === PACK[0]) {
  5448.               offset = 1;
  5449.               state = 2;
  5450.               continue;
  5451.             }
  5452.             state = -1;
  5453.             throw new SyntaxError("Not a hex char: " + String.fromCharCode(byte));
  5454.           }
  5455.           length |= val << ((--offset) * 4);
  5456.           if (offset === 0) {
  5457.             if (length === 4) {
  5458.               offset = 4;
  5459.               emit("");
  5460.             }
  5461.             else if (length === 0) {
  5462.               offset = 4;
  5463.               emit(null);
  5464.             }
  5465.             else if (length > 4) {
  5466.               length -= 4;
  5467.               data = bops.create(length);
  5468.               state = 1;
  5469.             }
  5470.             else {
  5471.               state = -1;
  5472.               throw new SyntaxError("Invalid length: " + length);
  5473.             }
  5474.           }
  5475.         }
  5476.         else if (state === 1) {
  5477.           data[offset++] = byte;
  5478.           if (offset === length) {
  5479.             offset = 4;
  5480.             state = 0;
  5481.             length = 0;
  5482.             if (data[0] === 1) {
  5483.               emit(bops.subarray(data, 1));
  5484.             }
  5485.             else if (data[0] === 2) {
  5486.               emit({progress: bops.to(bops.subarray(data, 1))});
  5487.             }
  5488.             else if (data[0] === 3) {
  5489.               emit({error: bops.to(bops.subarray(data, 1))});
  5490.             }
  5491.             else {
  5492.               emit(bops.to(data));
  5493.             }
  5494.           }
  5495.         }
  5496.         else if (state === 2) {
  5497.           if (offset < 4 && byte === PACK[offset++]) {
  5498.             continue;
  5499.           }
  5500.           state = 3;
  5501.           emit(bops.join([PACK, bops.subarray(item, i)]));
  5502.           break;
  5503.         }
  5504.         else {
  5505.           throw new Error("pkt-line decoder in invalid state");
  5506.         }
  5507.       }
  5508.     };
  5509.  
  5510.   }
  5511.  
  5512.   function framer(emit) {
  5513.     return function (item) {
  5514.       if (item === undefined) return emit();
  5515.       if (item === null) {
  5516.         emit(bops.from("0000"));
  5517.         return;
  5518.       }
  5519.       if (typeof item === "string") {
  5520.         item = bops.from(item);
  5521.       }
  5522.       emit(bops.join([frameHead(item.length + 4), item]));
  5523.     };
  5524.   }
  5525.  
  5526.   function frameHead(length) {
  5527.     var buffer = bops.create(4);
  5528.     buffer[0] = toHexChar(length >>> 12);
  5529.     buffer[1] = toHexChar((length >>> 8) & 0xf);
  5530.     buffer[2] = toHexChar((length >>> 4) & 0xf);
  5531.     buffer[3] = toHexChar(length & 0xf);
  5532.     return buffer;
  5533.   }
  5534.  
  5535.   function fromHexChar(val) {
  5536.     return (val >= 0x30 && val <  0x40) ? val - 0x30 :
  5537.           ((val >  0x60 && val <= 0x66) ? val - 0x57 : -1);
  5538.   }
  5539.  
  5540.   function toHexChar(val) {
  5541.     return val < 0x0a ? val + 0x30 : val + 0x57;
  5542.   }
  5543.  
  5544. };
  5545. };
  5546.  
  5547. defs["node_modules/git-net/smart-http.js"] = function (module, exports) {
  5548. module.exports = function (platform) {
  5549.   var writable = require('node_modules/git-net/writable.js');
  5550.   var sharedDiscover = require('node_modules/git-net/discover.js');
  5551.   var sharedFetch = require('node_modules/git-net/fetch.js');
  5552.   var pushToPull = require('node_modules/git-net/node_modules/push-to-pull/transform.js');
  5553.   var pktLine = require('node_modules/git-net/pkt-line.js')(platform);
  5554.   var framer = pushToPull(pktLine.framer);
  5555.   var deframer = pushToPull(pktLine.deframer);
  5556.   var http = platform.http;
  5557.   var trace = platform.trace;
  5558.   var bops = platform.bops;
  5559.   var agent = platform.agent;
  5560.   var urlParse = require('node_modules/git-net/url-parse.js');
  5561.  
  5562.   // opts.hostname - host to connect to (github.com)
  5563.   // opts.pathname - path to repo (/creationix/conquest.git)
  5564.   // opts.port - override default port (80 for http, 443 for https)
  5565.   return function (opts) {
  5566.     opts.tls = opts.protocol === "https:";
  5567.     opts.port = opts.port ? opts.port | 0 : (opts.tls ? 443 : 80);
  5568.     if (!opts.hostname) throw new TypeError("hostname is a required option");
  5569.     if (!opts.pathname) throw new TypeError("pathname is a required option");
  5570.  
  5571.     opts.discover = discover;
  5572.     opts.fetch = fetch;
  5573.     opts.close = closeConnection;
  5574.  
  5575.     var write, read, abort, cb, error, pathname, headers;
  5576.  
  5577.     return opts;
  5578.  
  5579.     function connect() {
  5580.       write = writable();
  5581.       var output = write;
  5582.       if (trace) output = trace("output", output);
  5583.       output = framer(output);
  5584.       read = null;
  5585.       abort = null;
  5586.       post(pathname, headers, output, onResponse);
  5587.     }
  5588.  
  5589.     function onResponse(err, code, headers, body) {
  5590.       if (err) return onError(err);
  5591.       if (code !== 200) return onError(new Error("Unexpected status code " + code));
  5592.       if (headers['content-type'] !== 'application/x-git-upload-pack-result') {
  5593.         return onError(new Error("Wrong content-type in server response"));
  5594.       }
  5595.       body = deframer(body);
  5596.       if (trace) body = trace("input", body);
  5597.       read = body.read;
  5598.       abort = body.abort;
  5599.  
  5600.       if (cb) {
  5601.         var callback = cb;
  5602.         cb = null;
  5603.         return read(callback);
  5604.       }
  5605.     }
  5606.  
  5607.     function onError(err) {
  5608.       if (cb) {
  5609.         var callback = cb;
  5610.         cb = null;
  5611.         return callback(err);
  5612.       }
  5613.       error = err;
  5614.     }
  5615.  
  5616.     function enqueue(callback) {
  5617.       if (error) {
  5618.         var err = error;
  5619.         error = null;
  5620.         return callback(err);
  5621.       }
  5622.       cb = callback;
  5623.     }
  5624.  
  5625.  
  5626.     function addDefaults(extras) {
  5627.  
  5628.       var headers = {
  5629.         "User-Agent": agent,
  5630.         "Host": opts.hostname,
  5631.       };
  5632.  
  5633.       // Hack to workaround gist bug.
  5634.       // https://github.com/creationix/js-git/issues/25
  5635.       if (opts.hostname === "gist.github.com") {
  5636.         headers["User-Agent"] = "git/1.8.1.2";
  5637.         headers["X-Real-User-Agent"] = agent;
  5638.       }
  5639.  
  5640.       for (var key in extras) {
  5641.         headers[key] = extras[key];
  5642.       }
  5643.       return headers;
  5644.     }
  5645.  
  5646.     function get(path, headers, callback) {
  5647.       return http.request({
  5648.         method: "GET",
  5649.         hostname: opts.hostname,
  5650.         tls: opts.tls,
  5651.         port: opts.port,
  5652.         auth: opts.auth,
  5653.         path: opts.pathname + path,
  5654.         headers: addDefaults(headers)
  5655.       }, onGet);
  5656.  
  5657.       function onGet(err, code, responseHeaders, body) {
  5658.         if (err) return callback(err);
  5659.         if (code === 301) {
  5660.           var uri = urlParse(responseHeaders.location);
  5661.           opts.protocol = uri.protocol;
  5662.           opts.hostname = uri.hostname;
  5663.           opts.tls = uri.protocol === "https:";
  5664.           opts.port = uri.port;
  5665.           opts.auth = uri.auth;
  5666.           opts.pathname = uri.path.replace(path, "");
  5667.           return get(path, headers, callback);
  5668.         }
  5669.         return callback(err, code, responseHeaders, body);
  5670.       }
  5671.     }
  5672.  
  5673.     function buffer(body, callback) {
  5674.       var parts = [];
  5675.       body.read(onRead);
  5676.       function onRead(err, item) {
  5677.         if (err) return callback(err);
  5678.         if (item === undefined) {
  5679.           return callback(null, bops.join(parts));
  5680.         }
  5681.         parts.push(item);
  5682.         body.read(onRead);
  5683.       }
  5684.     }
  5685.  
  5686.     function post(path, headers, body, callback) {
  5687.       headers = addDefaults(headers);
  5688.       if (typeof body === "string") {
  5689.         body = bops.from(body);
  5690.       }
  5691.       if (bops.is(body)) {
  5692.         headers["Content-Length"] = body.length;
  5693.       }
  5694.       else {
  5695.         if (headers['Transfer-Encoding'] !== 'chunked') {
  5696.           return buffer(body, function (err, body) {
  5697.             if (err) return callback(err);
  5698.             headers["Content-Length"] = body.length;
  5699.             send(body);
  5700.           });
  5701.         }
  5702.       }
  5703.       send(body);
  5704.       function send(body) {
  5705.         http.request({
  5706.           method: "POST",
  5707.           hostname: opts.hostname,
  5708.           tls: opts.tls,
  5709.           port: opts.port,
  5710.           auth: opts.auth,
  5711.           path: opts.pathname + path,
  5712.           headers: headers,
  5713.           body: body
  5714.         }, callback);
  5715.       }
  5716.     }
  5717.  
  5718.     // Send initial git-upload-pack request
  5719.     // outputs refs and caps
  5720.     function discover(callback) {
  5721.       if (!callback) return discover.bind(this);
  5722.       get("/info/refs?service=git-upload-pack", {
  5723.         "Accept": "*/*",
  5724.         "Accept-Encoding": "gzip",
  5725.         "Pragma": "no-cache"
  5726.       }, function (err, code, headers, body) {
  5727.         if (err) return callback(err);
  5728.         if (code !== 200) return callback(new Error("Unexpected status code " + code));
  5729.         if (headers['content-type'] !== 'application/x-git-upload-pack-advertisement') {
  5730.           return callback(new Error("Wrong content-type in server response"));
  5731.         }
  5732.  
  5733.         body = deframer(body);
  5734.         if (trace) body = trace("input", body);
  5735.  
  5736.         body.read(function (err, line) {
  5737.           if (err) return callback(err);
  5738.           if (line.trim() !== '# service=git-upload-pack') {
  5739.             return callback(new Error("Missing expected service line"));
  5740.           }
  5741.           body.read(function (err, line) {
  5742.             if (err) return callback(err);
  5743.             if (line !== null) {
  5744.               return callback(new Error("Missing expected terminator"));
  5745.             }
  5746.             sharedDiscover(body, callback);
  5747.           });
  5748.         });
  5749.       });
  5750.     }
  5751.  
  5752.     function fetch(repo, opts, callback) {
  5753.       if (!callback) return fetch.bind(this, repo, opts);
  5754.       pathname = "/git-upload-pack";
  5755.       headers = {
  5756.         "Content-Type": "application/x-git-upload-pack-request",
  5757.         "Accept": "application/x-git-upload-pack-result",
  5758.       };
  5759.  
  5760.       return sharedFetch({
  5761.         read: resRead,
  5762.         abort: resAbort,
  5763.         write: resWrite
  5764.       }, repo, opts, callback);
  5765.     }
  5766.  
  5767.     function resRead(callback) {
  5768.       if (read) return read(callback);
  5769.       return enqueue(callback);
  5770.     }
  5771.  
  5772.     function resAbort(callback) {
  5773.       if (abort) return abort(callback);
  5774.       return callback();
  5775.     }
  5776.  
  5777.     function resWrite(line) {
  5778.       if (!write) connect();
  5779.       if (line === "done\n") {
  5780.         write(line);
  5781.         write();
  5782.         write = null;
  5783.       }
  5784.       else {
  5785.         write(line);
  5786.       }
  5787.     }
  5788.  
  5789.     function closeConnection(callback) {
  5790.       if (!callback) return closeConnection.bind(this);
  5791.       callback();
  5792.     }
  5793.   };
  5794. };
  5795. };
  5796.  
  5797. defs["node_modules/git-net/ws.js"] = function (module, exports) {
  5798.  
  5799. };
  5800.  
  5801. defs["node_modules/git-net/ssh.js"] = function (module, exports) {
  5802. module.exports = function (platform) {
  5803.   var writable = require('node_modules/git-net/writable.js');
  5804.   var sharedFetch = require('node_modules/git-net/fetch.js');
  5805.   var sharedDiscover = require('node_modules/git-net/discover.js');
  5806.   var pushToPull = require('node_modules/git-net/node_modules/push-to-pull/transform.js');
  5807.   var trace = platform.trace;
  5808.   var pktLine = require('node_modules/git-net/pkt-line.js')(platform);
  5809.   var framer = pushToPull(pktLine.framer);
  5810.   var deframer = pushToPull(pktLine.deframer);
  5811.   var ssh = platform.ssh;
  5812.  
  5813.   // opts.hostname - host to connect to (github.com)
  5814.   // opts.pathname - path to repo (/creationix/conquest.git)
  5815.   // opts.port - override default port (22)
  5816.   // opts.auth - username:password or just username
  5817.   // opts.privateKey - binary contents of private key to use.
  5818.   return function (opts) {
  5819.     if (!opts.hostname) throw new TypeError("hostname is a required option");
  5820.     if (!opts.pathname) throw new TypeError("pathname is a required option");
  5821.  
  5822.     var tunnel, connection;
  5823.  
  5824.     opts.discover = discover;
  5825.     opts.fetch = fetch;
  5826.     opts.close = closeConnection;
  5827.     return opts;
  5828.  
  5829.     function connect(command, callback) {
  5830.       if (connection) return callback();
  5831.       ssh(opts, function (err, result) {
  5832.         if (err) return callback(err);
  5833.         tunnel = result;
  5834.         tunnel.exec(command, function (err, socket) {
  5835.           if (err) return callback(err);
  5836.           var input = deframer(socket);
  5837.           if (trace) input = trace("input", input);
  5838.  
  5839.           var output = writable(input.abort);
  5840.           connection = {
  5841.             read: input.read,
  5842.             abort: input.abort,
  5843.             write: output
  5844.           };
  5845.           if (trace) output = trace("output", output);
  5846.           output = framer(output);
  5847.           socket.sink(output)(function (err) {
  5848.             throw err;
  5849.             // TODO: handle this better somehow
  5850.             // maybe allow writable streams
  5851.           });
  5852.           callback();
  5853.         });
  5854.       });
  5855.     }
  5856.  
  5857.     // Send initial git-upload-pack request
  5858.     // outputs refs and caps
  5859.     function discover(callback) {
  5860.       if (!callback) return discover.bind(this);
  5861.       if (!connection) {
  5862.         return connect("git-upload-pack", function (err) {
  5863.           if (err) return callback(err);
  5864.           return discover(callback);
  5865.         });
  5866.       }
  5867.       sharedDiscover(connection, callback);
  5868.     }
  5869.  
  5870.     function fetch(repo, opts, callback) {
  5871.       if (!callback) return fetch.bind(this, repo, opts);
  5872.       if (!connection) {
  5873.         return callback(new Error("Please connect before fetching"));
  5874.       }
  5875.       return sharedFetch(connection, repo, opts, callback);
  5876.     }
  5877.  
  5878.     function closeConnection(callback) {
  5879.       if (!callback) return closeConnection.bind(this);
  5880.       connection.write();
  5881.       tunnel.close();
  5882.       callback();
  5883.     }
  5884.  
  5885.   };
  5886.  
  5887. };
  5888. };
  5889.  
  5890. var realRequire = typeof require === 'undefined' ? null : require;
  5891.  
  5892. require = function require(name) {
  5893.   if (name in modules) return modules[name];
  5894.   if (!(name in defs)) {
  5895.     if (realRequire) return realRequire(name);
  5896.     throw new Error("Missing module: " + name);
  5897.   }
  5898.   var exports = modules[name] = {};
  5899.   var module = { exports: exports };
  5900.   var def = defs[name];
  5901.   def(module, exports);
  5902.   exports = modules[name] = module.exports;
  5903.   return exports;
  5904. }
  5905.  
  5906. require("src/core.js");
Add Comment
Please, Sign In to add comment