isomorphic-git
Advanced tools
Comparing version 0.0.34 to 0.0.35
@@ -1317,3 +1317,3 @@ 'use strict'; | ||
gitdir = _ref$gitdir === undefined ? path.join(dir, '.git') : _ref$gitdir, | ||
fs = _ref.fs, | ||
_fs = _ref.fs, | ||
_ref$ref = _ref.ref, | ||
@@ -1330,3 +1330,3 @@ ref = _ref$ref === undefined ? 'HEAD' : _ref$ref, | ||
onprogress = _ref.onprogress; | ||
var response, packfile, packfileSha; | ||
var fs, response, packfile, packfileSha; | ||
return _regeneratorRuntime.wrap(function _callee$(_context) { | ||
@@ -1336,3 +1336,4 @@ while (1) { | ||
case 0: | ||
_context.next = 2; | ||
fs = new models_js.FileSystem(_fs); | ||
_context.next = 3; | ||
return fetchPackfile({ | ||
@@ -1352,14 +1353,14 @@ gitdir: gitdir, | ||
case 2: | ||
case 3: | ||
response = _context.sent; | ||
_context.next = 5; | ||
_context.next = 6; | ||
return pify(concat)(response.packfile); | ||
case 5: | ||
case 6: | ||
packfile = _context.sent; | ||
packfileSha = packfile.slice(-20).toString('hex'); | ||
_context.next = 9; | ||
_context.next = 10; | ||
return fs.write(path.join(gitdir, 'objects/pack/pack-' + packfileSha + '.pack'), packfile); | ||
case 9: | ||
case 10: | ||
case 'end': | ||
@@ -1366,0 +1367,0 @@ return _context.stop(); |
@@ -128,12 +128,12 @@ 'use strict'; | ||
var engines = { "node": ">=7.6.0" }; | ||
var scripts = { "start": "nps", "test": "nps test", "precommit": "nps format toc", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }; | ||
var repository = { "type": "git", "url": "https://github.com/wmhilton/isomorphic-git.git" }; | ||
var keywords = ["git"]; | ||
var scripts = { "start": "nps", "test": "nps test", "precommit": "nps format toc", "prepush": "nps lint", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }; | ||
var repository = { "type": "git", "url": "https://github.com/isomorphic-git/isomorphic-git.git" }; | ||
var keywords = ["git", "isomorphic"]; | ||
var author = "William Hilton <wmhilton@gmail.com>"; | ||
var license = "Unlicense"; | ||
var bugs = { "url": "https://github.com/wmhilton/isomorphic-git/issues" }; | ||
var homepage = "https://github.com/wmhilton/isomorphic-git#readme"; | ||
var bugs = { "url": "https://github.com/isomorphic-git/isomorphic-git/issues" }; | ||
var homepage = "https://wmhilton.github.io/isomorphic-git"; | ||
var files = ["dist", "cli.js"]; | ||
var dependencies = { "async-lock": "^1.0.0", "await-stream-ready": "^1.0.1", "babel-runtime": "^6.26.0", "buffer": "^5.0.7", "buffer-peek-stream": "^1.0.1", "buffercursor": "0.0.12", "crc": "^3.5.0", "gartal": "^1.1.2", "git-apply-delta": "0.0.7", "git-list-pack": "0.0.10", "ignore": "^3.3.6", "ini": "^1.3.4", "marky": "^1.2.0", "minimisted": "^2.0.0", "openpgp": "^2.5.10", "pad": "^2.0.1", "pako": "^1.0.5", "pify": "^3.0.0", "shasum": "^1.0.2", "simple-concat": "^1.0.0", "simple-get": "^2.7.0", "through2": "^2.0.3" }; | ||
var devDependencies = { "babel-plugin-external-helpers": "^6.22.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.0", "babel-preset-flow": "^6.23.0", "ban-sensitive-files": "^1.9.0", "browserfs": "^1.4.3", "browserify": "^14.4.0", "browserify-shim": "^3.8.14", "codecov": "^3.0.0", "doctoc": "^1.3.0", "esdoc": "^1.0.4", "esdoc-ecmascript-proposal-plugin": "^1.0.0", "esdoc-importpath-plugin": "^1.0.1", "esdoc-standard-plugin": "^1.0.0", "husky": "^0.14.3", "jest": "^22.0.4", "jest-fixtures": "^0.6.0", "jsonfile": "^4.0.0", "karma": "^2.0.0", "karma-browserify": "^5.1.1", "karma-chrome-launcher": "^2.2.0", "karma-firefox-launcher": "^1.0.1", "karma-sauce-launcher": "^1.2.0", "karma-tap": "^3.1.1", "lodash": "^4.17.4", "nock": "^9.0.17", "npm-run-all": "^4.1.1", "nps": "^5.7.1", "nps-utils": "^1.4.0", "parse-header-stream": "^1.1.1", "prettier-standard": "^8.0.0", "rollup": "^0.53.0", "rollup-plugin-babel": "^3.0.2", "rollup-plugin-json": "^2.3.0", "semantic-release": "^8.2.0", "standard": "^10.0.3", "stream-equal": "^1.0.1", "tape": "^4.8.0", "uglify-es": "^3.1.2", "watch": "^1.0.2", "watchify": "^3.9.0" }; | ||
var devDependencies = { "babel-plugin-external-helpers": "^6.22.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.0", "babel-preset-flow": "^6.23.0", "ban-sensitive-files": "^1.9.0", "browserfs": "^1.4.3", "browserify": "^14.4.0", "browserify-shim": "^3.8.14", "codecov": "^3.0.0", "doctoc": "^1.3.0", "esdoc": "^1.0.4", "esdoc-ecmascript-proposal-plugin": "^1.0.0", "esdoc-importpath-plugin": "^1.0.1", "esdoc-inject-script-plugin": "^1.0.0", "esdoc-standard-plugin": "^1.0.0", "husky": "^0.14.3", "jest": "^22.0.4", "jest-fixtures": "^0.6.0", "jsonfile": "^4.0.0", "karma": "^2.0.0", "karma-browserify": "^5.1.1", "karma-chrome-launcher": "^2.2.0", "karma-firefox-launcher": "^1.0.1", "karma-sauce-launcher": "^1.2.0", "karma-tap": "^3.1.1", "lodash": "^4.17.4", "nock": "^9.0.17", "npm-run-all": "^4.1.1", "nps": "^5.7.1", "nps-utils": "^1.4.0", "parse-header-stream": "^1.1.1", "prettier-standard": "^8.0.0", "rollup": "^0.53.0", "rollup-plugin-babel": "^3.0.2", "rollup-plugin-json": "^2.3.0", "semantic-release": "^8.2.0", "standard": "^10.0.3", "stream-equal": "^1.0.1", "tape": "^4.8.0", "uglify-es": "^3.1.2", "watch": "^1.0.2", "watchify": "^3.9.0" }; | ||
var ava = { "source": ["dist/for-node/*"] }; | ||
@@ -214,3 +214,3 @@ var browserify = { "transform": ["browserify-shim"] }; | ||
* @param {string} token | ||
* @returns {username, password} | ||
* @returns {{username: string, password: string}} | ||
* | ||
@@ -258,3 +258,3 @@ */ | ||
* @param {string} password | ||
* @returns {username, password} | ||
* @returns {{username: string, password: string}} | ||
* | ||
@@ -261,0 +261,0 @@ * @example |
@@ -164,3 +164,3 @@ import path from 'path'; | ||
gitdir = path.join(dir, '.git'), | ||
fs, | ||
fs: _fs, | ||
ref = 'HEAD', | ||
@@ -177,2 +177,3 @@ remote, | ||
}) { | ||
const fs = new FileSystem(_fs); | ||
let response = await fetchPackfile({ | ||
@@ -320,3 +321,4 @@ gitdir, | ||
async function writeTreeToDisk({ gitdir, dir, index, prefix, tree, fs }) { | ||
async function writeTreeToDisk({ fs: _fs, dir, gitdir, index, prefix, tree }) { | ||
const fs = new FileSystem(_fs); | ||
for (let entry of tree) { | ||
@@ -343,8 +345,8 @@ let { type, object } = await GitObjectManager.read({ | ||
await writeTreeToDisk({ | ||
fs, | ||
dir, | ||
gitdir, | ||
dir, | ||
index, | ||
prefix: entrypath, | ||
tree, | ||
fs | ||
tree | ||
}); | ||
@@ -429,3 +431,3 @@ break; | ||
// Update HEAD TODO: Handle non-branch cases | ||
fs.write(`${gitdir}/HEAD`, `ref: refs/heads/${ref}`); | ||
await fs.write(`${gitdir}/HEAD`, `ref: refs/heads/${ref}`); | ||
}); | ||
@@ -432,0 +434,0 @@ } |
@@ -9,2 +9,2 @@ import * as managers_js from './managers.js'; | ||
export { managers_js as managers, models_js as models, utils_js as utils }; | ||
export * from '/home/travis/build/wmhilton/isomorphic-git/src/commands.js'; | ||
export * from '/home/travis/build/isomorphic-git/isomorphic-git/src/commands.js'; |
import path from 'path'; | ||
import pify from 'pify'; | ||
import { sleep } from './utils.js'; | ||
import { Buffer as Buffer$1 } from 'buffer'; | ||
import { Buffer } from 'buffer'; | ||
import { key, message, sign, util } from 'openpgp/dist/openpgp.min.js'; | ||
@@ -232,3 +232,3 @@ import ini from 'ini'; | ||
this._commit = commit; | ||
} else if (Buffer$1.isBuffer(commit)) { | ||
} else if (Buffer.isBuffer(commit)) { | ||
this._commit = commit.toString('utf8'); | ||
@@ -254,3 +254,3 @@ } else if (typeof commit === 'object') { | ||
toObject() { | ||
return Buffer$1.from(this._commit, 'utf8'); | ||
return Buffer.from(this._commit, 'utf8'); | ||
} | ||
@@ -461,3 +461,3 @@ | ||
static hash({ type, object }) /*: Promise<string> */{ | ||
let buffer$$1 = Buffer$1.concat([Buffer$1.from(`${type} ${object.byteLength.toString()}\0`), Buffer$1.from(object)]); | ||
let buffer$$1 = Buffer.concat([Buffer.from(`${type} ${object.byteLength.toString()}\0`), Buffer.from(object)]); | ||
let oid = shasum(buffer$$1); | ||
@@ -467,11 +467,11 @@ return oid; | ||
static wrap({ type, object /*: {type: string, object: Buffer} */ }) { | ||
let buffer$$1 = Buffer$1.concat([Buffer$1.from(`${type} ${object.byteLength.toString()}\0`), object]); | ||
let buffer$$1 = Buffer.concat([Buffer.from(`${type} ${object.byteLength.toString()}\0`), object]); | ||
let oid = shasum(buffer$$1); | ||
return { | ||
oid, | ||
file: Buffer$1.from(pako.deflate(buffer$$1)) | ||
file: Buffer.from(pako.deflate(buffer$$1)) | ||
}; | ||
} | ||
static unwrap({ oid, file /*: {oid: string, file: Buffer} */ }) { | ||
let inflated = Buffer$1.from(pako.inflate(file)); | ||
let inflated = Buffer.from(pako.inflate(file)); | ||
if (oid) { | ||
@@ -494,3 +494,3 @@ let sha = shasum(inflated); | ||
type, | ||
object: Buffer$1.from(inflated.slice(i + 1)) | ||
object: Buffer.from(inflated.slice(i + 1)) | ||
}; | ||
@@ -558,3 +558,3 @@ } | ||
static flush() { | ||
return Buffer$1.from('0000', 'utf8'); | ||
return Buffer.from('0000', 'utf8'); | ||
} | ||
@@ -564,7 +564,7 @@ | ||
if (typeof line === 'string') { | ||
line = Buffer$1.from(line); | ||
line = Buffer.from(line); | ||
} | ||
let length = line.length + 4; | ||
let hexlength = pad(4, length.toString(16), '0'); | ||
return Buffer$1.concat([Buffer$1.from(hexlength, 'utf8'), line]); | ||
return Buffer.concat([Buffer.from(hexlength, 'utf8'), line]); | ||
} | ||
@@ -739,3 +739,3 @@ | ||
console.log('Indexing objects'); | ||
console.log(`percent\tmilliseconds\tkilobytes\tbytesProcessed\tcommits\ttrees\tblobs\ttags\tofs-deltas\tref-deltas`); | ||
console.log(`percent\tmilliseconds\tbytesProcessed\tcommits\ttrees\tblobs\ttags\tofs-deltas\tref-deltas`); | ||
marky.mark('total'); | ||
@@ -749,3 +749,3 @@ marky.mark('offsets'); | ||
if (percent !== lastPercent) { | ||
console.log(`${percent}%\t${Math.floor(marky.stop('percent').duration)}\t${Math.floor(process.memoryUsage().rss / 1000)}\t${bytesProcessed}\t${histogram.commit}\t${histogram.tree}\t${histogram.blob}\t${histogram.tag}\t${histogram['ofs-delta']}\t${histogram['ref-delta']}`); | ||
console.log(`${percent}%\t${Math.floor(marky.stop('percent').duration)}\t${bytesProcessed}\t${histogram.commit}\t${histogram.tree}\t${histogram.blob}\t${histogram.tag}\t${histogram['ofs-delta']}\t${histogram['ref-delta']}`); | ||
@@ -816,3 +816,3 @@ histogram = { | ||
console.log('Resolving deltas'); | ||
console.log(`percent2\tmilliseconds2\tkilobytes2\tcallsToReadSlice\tcallsToGetExternal`); | ||
console.log(`percent2\tmilliseconds2\tcallsToReadSlice\tcallsToGetExternal`); | ||
marky.mark('percent'); | ||
@@ -829,3 +829,3 @@ lastPercent = null; | ||
if (percent !== lastPercent) { | ||
console.log(`${percent}%\t${Math.floor(marky.stop('percent').duration)}\t${Math.floor(process.memoryUsage().rss / 1000)}\t${callsToReadSlice}\t${callsToGetExternal}`); | ||
console.log(`${percent}%\t${Math.floor(marky.stop('percent').duration)}\t${callsToReadSlice}\t${callsToGetExternal}`); | ||
marky.mark('percent'); | ||
@@ -876,6 +876,2 @@ callsToReadSlice = 0; | ||
console.log(timeByDepth.map(Math.floor).slice(0, 12).join('\t')); | ||
// CONTINUE HERE: Probably we need an LRU cache to speed up deltas. | ||
// We could plot a histogram of oids to see how many oids we need to cache to have a big impact. | ||
return p; | ||
@@ -996,3 +992,3 @@ } | ||
if (base) { | ||
object = applyDelta(object, base); | ||
object = Buffer.from(applyDelta(object, base)); | ||
} | ||
@@ -1113,3 +1109,3 @@ // Cache the result based on depth. | ||
this._dirty = false; | ||
if (Buffer$1.isBuffer(index)) { | ||
if (Buffer.isBuffer(index)) { | ||
this._entries = parseBuffer(index); | ||
@@ -1179,3 +1175,3 @@ } else if (index === null) { | ||
toObject() { | ||
let header = Buffer$1.alloc(12); | ||
let header = Buffer.alloc(12); | ||
let writer = new BufferCursor(header); | ||
@@ -1185,6 +1181,6 @@ writer.write('DIRC', 4, 'utf8'); | ||
writer.writeUInt32BE(this.entries.length); | ||
let body = Buffer$1.concat(this.entries.map(entry => { | ||
let body = Buffer.concat(this.entries.map(entry => { | ||
// the fixed length + the filename + at least one null char => align by 8 | ||
let length = Math.ceil((62 + entry.path.length + 1) / 8) * 8; | ||
let written = Buffer$1.alloc(length); | ||
let written = Buffer.alloc(length); | ||
let writer = new BufferCursor(written); | ||
@@ -1212,5 +1208,5 @@ let ctimeMilliseconds = entry.ctime.valueOf(); | ||
})); | ||
let main = Buffer$1.concat([header, body]); | ||
let main = Buffer.concat([header, body]); | ||
let sum = shasum(main); | ||
return Buffer$1.concat([main, Buffer$1.from(sum, 'hex')]); | ||
return Buffer.concat([main, Buffer.from(sum, 'hex')]); | ||
} | ||
@@ -1271,3 +1267,3 @@ } | ||
constructor(entries /*: any */) { | ||
if (Buffer$1.isBuffer(entries)) { | ||
if (Buffer.isBuffer(entries)) { | ||
this._entries = parseBuffer$1(entries); | ||
@@ -1287,9 +1283,9 @@ } else if (Array.isArray(entries)) { | ||
toObject() { | ||
return Buffer$1.concat(this._entries.map(entry => { | ||
let mode = Buffer$1.from(entry.mode.replace(/^0/, '')); | ||
let space = Buffer$1.from(' '); | ||
let path$$1 = Buffer$1.from(entry.path, { encoding: 'utf8' }); | ||
let nullchar = Buffer$1.from([0]); | ||
let oid = Buffer$1.from(entry.oid.match(/../g).map(n => parseInt(n, 16))); | ||
return Buffer$1.concat([mode, space, path$$1, nullchar, oid]); | ||
return Buffer.concat(this._entries.map(entry => { | ||
let mode = Buffer.from(entry.mode.replace(/^0/, '')); | ||
let space = Buffer.from(' '); | ||
let path$$1 = Buffer.from(entry.path, { encoding: 'utf8' }); | ||
let nullchar = Buffer.from([0]); | ||
let oid = Buffer.from(entry.oid.match(/../g).map(n => parseInt(n, 16))); | ||
return Buffer.concat([mode, space, path$$1, nullchar, oid]); | ||
})); | ||
@@ -1296,0 +1292,0 @@ } |
@@ -76,12 +76,12 @@ import path from 'path'; | ||
var engines = { "node": ">=7.6.0" }; | ||
var scripts = { "start": "nps", "test": "nps test", "precommit": "nps format toc", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }; | ||
var repository = { "type": "git", "url": "https://github.com/wmhilton/isomorphic-git.git" }; | ||
var keywords = ["git"]; | ||
var scripts = { "start": "nps", "test": "nps test", "precommit": "nps format toc", "prepush": "nps lint", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }; | ||
var repository = { "type": "git", "url": "https://github.com/isomorphic-git/isomorphic-git.git" }; | ||
var keywords = ["git", "isomorphic"]; | ||
var author = "William Hilton <wmhilton@gmail.com>"; | ||
var license = "Unlicense"; | ||
var bugs = { "url": "https://github.com/wmhilton/isomorphic-git/issues" }; | ||
var homepage = "https://github.com/wmhilton/isomorphic-git#readme"; | ||
var bugs = { "url": "https://github.com/isomorphic-git/isomorphic-git/issues" }; | ||
var homepage = "https://wmhilton.github.io/isomorphic-git"; | ||
var files = ["dist", "cli.js"]; | ||
var dependencies = { "async-lock": "^1.0.0", "await-stream-ready": "^1.0.1", "babel-runtime": "^6.26.0", "buffer": "^5.0.7", "buffer-peek-stream": "^1.0.1", "buffercursor": "0.0.12", "crc": "^3.5.0", "gartal": "^1.1.2", "git-apply-delta": "0.0.7", "git-list-pack": "0.0.10", "ignore": "^3.3.6", "ini": "^1.3.4", "marky": "^1.2.0", "minimisted": "^2.0.0", "openpgp": "^2.5.10", "pad": "^2.0.1", "pako": "^1.0.5", "pify": "^3.0.0", "shasum": "^1.0.2", "simple-concat": "^1.0.0", "simple-get": "^2.7.0", "through2": "^2.0.3" }; | ||
var devDependencies = { "babel-plugin-external-helpers": "^6.22.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.0", "babel-preset-flow": "^6.23.0", "ban-sensitive-files": "^1.9.0", "browserfs": "^1.4.3", "browserify": "^14.4.0", "browserify-shim": "^3.8.14", "codecov": "^3.0.0", "doctoc": "^1.3.0", "esdoc": "^1.0.4", "esdoc-ecmascript-proposal-plugin": "^1.0.0", "esdoc-importpath-plugin": "^1.0.1", "esdoc-standard-plugin": "^1.0.0", "husky": "^0.14.3", "jest": "^22.0.4", "jest-fixtures": "^0.6.0", "jsonfile": "^4.0.0", "karma": "^2.0.0", "karma-browserify": "^5.1.1", "karma-chrome-launcher": "^2.2.0", "karma-firefox-launcher": "^1.0.1", "karma-sauce-launcher": "^1.2.0", "karma-tap": "^3.1.1", "lodash": "^4.17.4", "nock": "^9.0.17", "npm-run-all": "^4.1.1", "nps": "^5.7.1", "nps-utils": "^1.4.0", "parse-header-stream": "^1.1.1", "prettier-standard": "^8.0.0", "rollup": "^0.53.0", "rollup-plugin-babel": "^3.0.2", "rollup-plugin-json": "^2.3.0", "semantic-release": "^8.2.0", "standard": "^10.0.3", "stream-equal": "^1.0.1", "tape": "^4.8.0", "uglify-es": "^3.1.2", "watch": "^1.0.2", "watchify": "^3.9.0" }; | ||
var devDependencies = { "babel-plugin-external-helpers": "^6.22.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.0", "babel-preset-flow": "^6.23.0", "ban-sensitive-files": "^1.9.0", "browserfs": "^1.4.3", "browserify": "^14.4.0", "browserify-shim": "^3.8.14", "codecov": "^3.0.0", "doctoc": "^1.3.0", "esdoc": "^1.0.4", "esdoc-ecmascript-proposal-plugin": "^1.0.0", "esdoc-importpath-plugin": "^1.0.1", "esdoc-inject-script-plugin": "^1.0.0", "esdoc-standard-plugin": "^1.0.0", "husky": "^0.14.3", "jest": "^22.0.4", "jest-fixtures": "^0.6.0", "jsonfile": "^4.0.0", "karma": "^2.0.0", "karma-browserify": "^5.1.1", "karma-chrome-launcher": "^2.2.0", "karma-firefox-launcher": "^1.0.1", "karma-sauce-launcher": "^1.2.0", "karma-tap": "^3.1.1", "lodash": "^4.17.4", "nock": "^9.0.17", "npm-run-all": "^4.1.1", "nps": "^5.7.1", "nps-utils": "^1.4.0", "parse-header-stream": "^1.1.1", "prettier-standard": "^8.0.0", "rollup": "^0.53.0", "rollup-plugin-babel": "^3.0.2", "rollup-plugin-json": "^2.3.0", "semantic-release": "^8.2.0", "standard": "^10.0.3", "stream-equal": "^1.0.1", "tape": "^4.8.0", "uglify-es": "^3.1.2", "watch": "^1.0.2", "watchify": "^3.9.0" }; | ||
var ava = { "source": ["dist/for-node/*"] }; | ||
@@ -162,3 +162,3 @@ var browserify = { "transform": ["browserify-shim"] }; | ||
* @param {string} token | ||
* @returns {username, password} | ||
* @returns {{username: string, password: string}} | ||
* | ||
@@ -206,3 +206,3 @@ */ | ||
* @param {string} password | ||
* @returns {username, password} | ||
* @returns {{username: string, password: string}} | ||
* | ||
@@ -209,0 +209,0 @@ * @example |
@@ -170,3 +170,3 @@ 'use strict'; | ||
gitdir = path.join(dir, '.git'), | ||
fs, | ||
fs: _fs, | ||
ref = 'HEAD', | ||
@@ -183,2 +183,3 @@ remote, | ||
}) { | ||
const fs = new models_js.FileSystem(_fs); | ||
let response = await fetchPackfile({ | ||
@@ -326,3 +327,4 @@ gitdir, | ||
async function writeTreeToDisk({ gitdir, dir, index, prefix, tree, fs }) { | ||
async function writeTreeToDisk({ fs: _fs, dir, gitdir, index, prefix, tree }) { | ||
const fs = new models_js.FileSystem(_fs); | ||
for (let entry of tree) { | ||
@@ -349,8 +351,8 @@ let { type, object } = await managers_js.GitObjectManager.read({ | ||
await writeTreeToDisk({ | ||
fs, | ||
dir, | ||
gitdir, | ||
dir, | ||
index, | ||
prefix: entrypath, | ||
tree, | ||
fs | ||
tree | ||
}); | ||
@@ -435,3 +437,3 @@ break; | ||
// Update HEAD TODO: Handle non-branch cases | ||
fs.write(`${gitdir}/HEAD`, `ref: refs/heads/${ref}`); | ||
await fs.write(`${gitdir}/HEAD`, `ref: refs/heads/${ref}`); | ||
}); | ||
@@ -438,0 +440,0 @@ } |
@@ -738,3 +738,3 @@ 'use strict'; | ||
console.log('Indexing objects'); | ||
console.log(`percent\tmilliseconds\tkilobytes\tbytesProcessed\tcommits\ttrees\tblobs\ttags\tofs-deltas\tref-deltas`); | ||
console.log(`percent\tmilliseconds\tbytesProcessed\tcommits\ttrees\tblobs\ttags\tofs-deltas\tref-deltas`); | ||
marky.mark('total'); | ||
@@ -748,3 +748,3 @@ marky.mark('offsets'); | ||
if (percent !== lastPercent) { | ||
console.log(`${percent}%\t${Math.floor(marky.stop('percent').duration)}\t${Math.floor(process.memoryUsage().rss / 1000)}\t${bytesProcessed}\t${histogram.commit}\t${histogram.tree}\t${histogram.blob}\t${histogram.tag}\t${histogram['ofs-delta']}\t${histogram['ref-delta']}`); | ||
console.log(`${percent}%\t${Math.floor(marky.stop('percent').duration)}\t${bytesProcessed}\t${histogram.commit}\t${histogram.tree}\t${histogram.blob}\t${histogram.tag}\t${histogram['ofs-delta']}\t${histogram['ref-delta']}`); | ||
@@ -815,3 +815,3 @@ histogram = { | ||
console.log('Resolving deltas'); | ||
console.log(`percent2\tmilliseconds2\tkilobytes2\tcallsToReadSlice\tcallsToGetExternal`); | ||
console.log(`percent2\tmilliseconds2\tcallsToReadSlice\tcallsToGetExternal`); | ||
marky.mark('percent'); | ||
@@ -828,3 +828,3 @@ lastPercent = null; | ||
if (percent !== lastPercent) { | ||
console.log(`${percent}%\t${Math.floor(marky.stop('percent').duration)}\t${Math.floor(process.memoryUsage().rss / 1000)}\t${callsToReadSlice}\t${callsToGetExternal}`); | ||
console.log(`${percent}%\t${Math.floor(marky.stop('percent').duration)}\t${callsToReadSlice}\t${callsToGetExternal}`); | ||
marky.mark('percent'); | ||
@@ -875,6 +875,2 @@ callsToReadSlice = 0; | ||
console.log(timeByDepth.map(Math.floor).slice(0, 12).join('\t')); | ||
// CONTINUE HERE: Probably we need an LRU cache to speed up deltas. | ||
// We could plot a histogram of oids to see how many oids we need to cache to have a big impact. | ||
return p; | ||
@@ -885,3 +881,3 @@ } | ||
let write = (str, encoding) => { | ||
buffers.push(Buffer.from(str, encoding)); | ||
buffers.push(buffer.Buffer.from(str, encoding)); | ||
}; | ||
@@ -893,3 +889,3 @@ // Write out IDX v2 magic number | ||
// Write fanout table | ||
let fanoutBuffer = new BufferCursor(Buffer.alloc(256 * 4)); | ||
let fanoutBuffer = new BufferCursor(buffer.Buffer.alloc(256 * 4)); | ||
for (let i = 0; i < 256; i++) { | ||
@@ -908,3 +904,3 @@ let count = 0; | ||
// Write out crcs | ||
let crcsBuffer = new BufferCursor(Buffer.alloc(this.hashes.length * 4)); | ||
let crcsBuffer = new BufferCursor(buffer.Buffer.alloc(this.hashes.length * 4)); | ||
for (let hash of this.hashes) { | ||
@@ -915,3 +911,3 @@ crcsBuffer.writeUInt32BE(this.crcs[hash]); | ||
// Write out offsets | ||
let offsetsBuffer = new BufferCursor(Buffer.alloc(this.hashes.length * 4)); | ||
let offsetsBuffer = new BufferCursor(buffer.Buffer.alloc(this.hashes.length * 4)); | ||
for (let hash of this.hashes) { | ||
@@ -924,7 +920,7 @@ offsetsBuffer.writeUInt32BE(this.offsets[hash]); | ||
// Write out shasum | ||
let totalBuffer = Buffer.concat(buffers); | ||
let totalBuffer = buffer.Buffer.concat(buffers); | ||
let sha = shasum(totalBuffer); | ||
let shaBuffer = Buffer.alloc(20); | ||
let shaBuffer = buffer.Buffer.alloc(20); | ||
shaBuffer.write(sha, 'hex'); | ||
return Buffer.concat([totalBuffer, shaBuffer]); | ||
return buffer.Buffer.concat([totalBuffer, shaBuffer]); | ||
} | ||
@@ -994,3 +990,3 @@ async load({ pack }) { | ||
let buffer$$1 = raw.slice(reader.tell()); | ||
object = Buffer.from(pako.inflate(buffer$$1)); | ||
object = buffer.Buffer.from(pako.inflate(buffer$$1)); | ||
// Assert that the object length is as expected. | ||
@@ -1001,3 +997,3 @@ if (object.byteLength !== length) { | ||
if (base) { | ||
object = applyDelta(object, base); | ||
object = buffer.Buffer.from(applyDelta(object, base)); | ||
} | ||
@@ -1004,0 +1000,0 @@ // Cache the result based on depth. |
@@ -82,12 +82,12 @@ 'use strict'; | ||
var engines = { "node": ">=7.6.0" }; | ||
var scripts = { "start": "nps", "test": "nps test", "precommit": "nps format toc", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }; | ||
var repository = { "type": "git", "url": "https://github.com/wmhilton/isomorphic-git.git" }; | ||
var keywords = ["git"]; | ||
var scripts = { "start": "nps", "test": "nps test", "precommit": "nps format toc", "prepush": "nps lint", "semantic-release": "semantic-release pre && npm publish && semantic-release post" }; | ||
var repository = { "type": "git", "url": "https://github.com/isomorphic-git/isomorphic-git.git" }; | ||
var keywords = ["git", "isomorphic"]; | ||
var author = "William Hilton <wmhilton@gmail.com>"; | ||
var license = "Unlicense"; | ||
var bugs = { "url": "https://github.com/wmhilton/isomorphic-git/issues" }; | ||
var homepage = "https://github.com/wmhilton/isomorphic-git#readme"; | ||
var bugs = { "url": "https://github.com/isomorphic-git/isomorphic-git/issues" }; | ||
var homepage = "https://wmhilton.github.io/isomorphic-git"; | ||
var files = ["dist", "cli.js"]; | ||
var dependencies = { "async-lock": "^1.0.0", "await-stream-ready": "^1.0.1", "babel-runtime": "^6.26.0", "buffer": "^5.0.7", "buffer-peek-stream": "^1.0.1", "buffercursor": "0.0.12", "crc": "^3.5.0", "gartal": "^1.1.2", "git-apply-delta": "0.0.7", "git-list-pack": "0.0.10", "ignore": "^3.3.6", "ini": "^1.3.4", "marky": "^1.2.0", "minimisted": "^2.0.0", "openpgp": "^2.5.10", "pad": "^2.0.1", "pako": "^1.0.5", "pify": "^3.0.0", "shasum": "^1.0.2", "simple-concat": "^1.0.0", "simple-get": "^2.7.0", "through2": "^2.0.3" }; | ||
var devDependencies = { "babel-plugin-external-helpers": "^6.22.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.0", "babel-preset-flow": "^6.23.0", "ban-sensitive-files": "^1.9.0", "browserfs": "^1.4.3", "browserify": "^14.4.0", "browserify-shim": "^3.8.14", "codecov": "^3.0.0", "doctoc": "^1.3.0", "esdoc": "^1.0.4", "esdoc-ecmascript-proposal-plugin": "^1.0.0", "esdoc-importpath-plugin": "^1.0.1", "esdoc-standard-plugin": "^1.0.0", "husky": "^0.14.3", "jest": "^22.0.4", "jest-fixtures": "^0.6.0", "jsonfile": "^4.0.0", "karma": "^2.0.0", "karma-browserify": "^5.1.1", "karma-chrome-launcher": "^2.2.0", "karma-firefox-launcher": "^1.0.1", "karma-sauce-launcher": "^1.2.0", "karma-tap": "^3.1.1", "lodash": "^4.17.4", "nock": "^9.0.17", "npm-run-all": "^4.1.1", "nps": "^5.7.1", "nps-utils": "^1.4.0", "parse-header-stream": "^1.1.1", "prettier-standard": "^8.0.0", "rollup": "^0.53.0", "rollup-plugin-babel": "^3.0.2", "rollup-plugin-json": "^2.3.0", "semantic-release": "^8.2.0", "standard": "^10.0.3", "stream-equal": "^1.0.1", "tape": "^4.8.0", "uglify-es": "^3.1.2", "watch": "^1.0.2", "watchify": "^3.9.0" }; | ||
var devDependencies = { "babel-plugin-external-helpers": "^6.22.0", "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-env": "^1.6.0", "babel-preset-flow": "^6.23.0", "ban-sensitive-files": "^1.9.0", "browserfs": "^1.4.3", "browserify": "^14.4.0", "browserify-shim": "^3.8.14", "codecov": "^3.0.0", "doctoc": "^1.3.0", "esdoc": "^1.0.4", "esdoc-ecmascript-proposal-plugin": "^1.0.0", "esdoc-importpath-plugin": "^1.0.1", "esdoc-inject-script-plugin": "^1.0.0", "esdoc-standard-plugin": "^1.0.0", "husky": "^0.14.3", "jest": "^22.0.4", "jest-fixtures": "^0.6.0", "jsonfile": "^4.0.0", "karma": "^2.0.0", "karma-browserify": "^5.1.1", "karma-chrome-launcher": "^2.2.0", "karma-firefox-launcher": "^1.0.1", "karma-sauce-launcher": "^1.2.0", "karma-tap": "^3.1.1", "lodash": "^4.17.4", "nock": "^9.0.17", "npm-run-all": "^4.1.1", "nps": "^5.7.1", "nps-utils": "^1.4.0", "parse-header-stream": "^1.1.1", "prettier-standard": "^8.0.0", "rollup": "^0.53.0", "rollup-plugin-babel": "^3.0.2", "rollup-plugin-json": "^2.3.0", "semantic-release": "^8.2.0", "standard": "^10.0.3", "stream-equal": "^1.0.1", "tape": "^4.8.0", "uglify-es": "^3.1.2", "watch": "^1.0.2", "watchify": "^3.9.0" }; | ||
var ava = { "source": ["dist/for-node/*"] }; | ||
@@ -168,3 +168,3 @@ var browserify = { "transform": ["browserify-shim"] }; | ||
* @param {string} token | ||
* @returns {username, password} | ||
* @returns {{username: string, password: string}} | ||
* | ||
@@ -212,3 +212,3 @@ */ | ||
* @param {string} password | ||
* @returns {username, password} | ||
* @returns {{username: string, password: string}} | ||
* | ||
@@ -215,0 +215,0 @@ * @example |
@@ -1,1 +0,1 @@ | ||
{"name":"isomorphic-git","version":"0.0.34","description":"A pure JavaScript implementation of git for node and browsers!","typings":"./src/index.d.ts","main":"dist/for-node/","browser":"dist/for-browserify/","module":"dist/for-future/","unpkg":"dist/bundle.umd.min.js","bin":{"isogit":"./cli.js"},"engines":{"node":">=7.6.0"},"scripts":{"start":"nps","test":"nps test","precommit":"nps format toc","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"repository":{"type":"git","url":"https://github.com/wmhilton/isomorphic-git.git"},"keywords":["git"],"author":"William Hilton <wmhilton@gmail.com>","license":"Unlicense","bugs":{"url":"https://github.com/wmhilton/isomorphic-git/issues"},"homepage":"https://github.com/wmhilton/isomorphic-git#readme","files":["dist","cli.js"],"dependencies":{"async-lock":"^1.0.0","await-stream-ready":"^1.0.1","babel-runtime":"^6.26.0","buffer":"^5.0.7","buffer-peek-stream":"^1.0.1","buffercursor":"0.0.12","crc":"^3.5.0","gartal":"^1.1.2","git-apply-delta":"0.0.7","git-list-pack":"0.0.10","ignore":"^3.3.6","ini":"^1.3.4","marky":"^1.2.0","minimisted":"^2.0.0","openpgp":"^2.5.10","pad":"^2.0.1","pako":"^1.0.5","pify":"^3.0.0","shasum":"^1.0.2","simple-concat":"^1.0.0","simple-get":"^2.7.0","through2":"^2.0.3"},"devDependencies":{"babel-plugin-external-helpers":"^6.22.0","babel-plugin-transform-es2015-modules-commonjs":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.23.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","ban-sensitive-files":"^1.9.0","browserfs":"^1.4.3","browserify":"^14.4.0","browserify-shim":"^3.8.14","codecov":"^3.0.0","doctoc":"^1.3.0","esdoc":"^1.0.4","esdoc-ecmascript-proposal-plugin":"^1.0.0","esdoc-importpath-plugin":"^1.0.1","esdoc-standard-plugin":"^1.0.0","husky":"^0.14.3","jest":"^22.0.4","jest-fixtures":"^0.6.0","jsonfile":"^4.0.0","karma":"^2.0.0","karma-browserify":"^5.1.1","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.0.1","karma-sauce-launcher":"^1.2.0","karma-tap":"^3.1.1","lodash":"^4.17.4","nock":"^9.0.17","npm-run-all":"^4.1.1","nps":"^5.7.1","nps-utils":"^1.4.0","parse-header-stream":"^1.1.1","prettier-standard":"^8.0.0","rollup":"^0.53.0","rollup-plugin-babel":"^3.0.2","rollup-plugin-json":"^2.3.0","semantic-release":"^8.2.0","standard":"^10.0.3","stream-equal":"^1.0.1","tape":"^4.8.0","uglify-es":"^3.1.2","watch":"^1.0.2","watchify":"^3.9.0"},"ava":{"source":["dist/for-node/*"]},"browserify":{"transform":["browserify-shim"]},"browserify-shim":{"fs":"global:fs"},"testling":{"files":"testling/basic-test.js","browsers":["chrome/latest","firefox/latest","ie/latest"]},"jest":{"testPathIgnorePatterns":["__helpers__"],"testEnvironment":"node"}} | ||
{"name":"isomorphic-git","version":"0.0.35","description":"A pure JavaScript implementation of git for node and browsers!","typings":"./src/index.d.ts","main":"dist/for-node/","browser":"dist/for-browserify/","module":"dist/for-future/","unpkg":"dist/bundle.umd.min.js","bin":{"isogit":"./cli.js"},"engines":{"node":">=7.6.0"},"scripts":{"start":"nps","test":"nps test","precommit":"nps format toc","prepush":"nps lint","semantic-release":"semantic-release pre && npm publish && semantic-release post"},"repository":{"type":"git","url":"https://github.com/isomorphic-git/isomorphic-git.git"},"keywords":["git","isomorphic"],"author":"William Hilton <wmhilton@gmail.com>","license":"Unlicense","bugs":{"url":"https://github.com/isomorphic-git/isomorphic-git/issues"},"homepage":"https://wmhilton.github.io/isomorphic-git","files":["dist","cli.js"],"dependencies":{"async-lock":"^1.0.0","await-stream-ready":"^1.0.1","babel-runtime":"^6.26.0","buffer":"^5.0.7","buffer-peek-stream":"^1.0.1","buffercursor":"0.0.12","crc":"^3.5.0","gartal":"^1.1.2","git-apply-delta":"0.0.7","git-list-pack":"0.0.10","ignore":"^3.3.6","ini":"^1.3.4","marky":"^1.2.0","minimisted":"^2.0.0","openpgp":"^2.5.10","pad":"^2.0.1","pako":"^1.0.5","pify":"^3.0.0","shasum":"^1.0.2","simple-concat":"^1.0.0","simple-get":"^2.7.0","through2":"^2.0.3"},"devDependencies":{"babel-plugin-external-helpers":"^6.22.0","babel-plugin-transform-es2015-modules-commonjs":"^6.24.1","babel-plugin-transform-object-rest-spread":"^6.23.0","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","ban-sensitive-files":"^1.9.0","browserfs":"^1.4.3","browserify":"^14.4.0","browserify-shim":"^3.8.14","codecov":"^3.0.0","doctoc":"^1.3.0","esdoc":"^1.0.4","esdoc-ecmascript-proposal-plugin":"^1.0.0","esdoc-importpath-plugin":"^1.0.1","esdoc-inject-script-plugin":"^1.0.0","esdoc-standard-plugin":"^1.0.0","husky":"^0.14.3","jest":"^22.0.4","jest-fixtures":"^0.6.0","jsonfile":"^4.0.0","karma":"^2.0.0","karma-browserify":"^5.1.1","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.0.1","karma-sauce-launcher":"^1.2.0","karma-tap":"^3.1.1","lodash":"^4.17.4","nock":"^9.0.17","npm-run-all":"^4.1.1","nps":"^5.7.1","nps-utils":"^1.4.0","parse-header-stream":"^1.1.1","prettier-standard":"^8.0.0","rollup":"^0.53.0","rollup-plugin-babel":"^3.0.2","rollup-plugin-json":"^2.3.0","semantic-release":"^8.2.0","standard":"^10.0.3","stream-equal":"^1.0.1","tape":"^4.8.0","uglify-es":"^3.1.2","watch":"^1.0.2","watchify":"^3.9.0"},"ava":{"source":["dist/for-node/*"]},"browserify":{"transform":["browserify-shim"]},"browserify-shim":{"fs":"global:fs"},"testling":{"files":"testling/basic-test.js","browsers":["chrome/latest","firefox/latest","ie/latest"]},"jest":{"testPathIgnorePatterns":["__helpers__"],"testEnvironment":"node"}} |
@@ -1,2 +0,2 @@ | ||
# isomorphic-git ![node version](https://img.shields.io/node/v/isomorphic-git.svg) [![Build Status](https://travis-ci.org/wmhilton/isomorphic-git.svg?branch=master)](https://travis-ci.org/wmhilton/isomorphic-git) [![codecov](https://codecov.io/gh/wmhilton/isomorphic-git/branch/master/graph/badge.svg)](https://codecov.io/gh/wmhilton/isomorphic-git) [![dependencies](https://david-dm.org/wmhilton/isomorphic-git/status.svg)](https://david-dm.org/wmhilton/isomorphic-git) [![Known Vulnerabilities](https://snyk.io/test/github/wmhilton/isomorphic-git/badge.svg)](https://snyk.io/test/github/wmhilton/isomorphic-git) | ||
# isomorphic-git ![node version](https://img.shields.io/node/v/isomorphic-git.svg) [![Build Status](https://travis-ci.org/isomorphic-git/isomorphic-git.svg?branch=master)](https://travis-ci.org/isomorphic-git/isomorphic-git) [![codecov](https://codecov.io/gh/isomorphic-git/isomorphic-git/branch/master/graph/badge.svg)](https://codecov.io/gh/isomorphic-git/isomorphic-git) [![dependencies](https://david-dm.org/isomorphic-git/isomorphic-git/status.svg)](https://david-dm.org/isomorphic-git/isomorphic-git) [![Known Vulnerabilities](https://snyk.io/test/github/isomorphic-git/isomorphic-git/badge.svg)](https://snyk.io/test/github/isomorphic-git/isomorphic-git) | ||
A pure JavaScript implementation of git for node and browsers! | ||
@@ -198,2 +198,2 @@ | ||
This work is released under [The Unlicense](http://unlicense.org/) | ||
This work is released under [The Unlicense](http://unlicense.org/) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
199
9326482
44
26499
4