Socket
Socket
Sign inDemoInstall

isomorphic-git

Package Overview
Dependencies
Maintainers
1
Versions
408
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isomorphic-git - npm Package Compare versions

Comparing version 0.0.17 to 0.0.18

86

dist/for-browserify/index.js

@@ -53,2 +53,37 @@ 'use strict';

// This is so git().relative() is the same as git().relative(true)
// but you can still undo the flag later with git().relative(false)
var extendBool = function extendBool(self, array) {
var _loop2 = function _loop2(fn) {
self[fn] = function (val) {
return self.set(fn, val !== false);
};
};
var _iteratorNormalCompletion2 = true;
var _didIteratorError2 = false;
var _iteratorError2 = undefined;
try {
for (var _iterator2 = _getIterator(array), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
var fn = _step2.value;
_loop2(fn);
}
} catch (err) {
_didIteratorError2 = true;
_iteratorError2 = err;
} finally {
try {
if (!_iteratorNormalCompletion2 && _iterator2.return) {
_iterator2.return();
}
} finally {
if (_didIteratorError2) {
throw _iteratorError2;
}
}
}
};
// The class is merely a fluent command/query builder

@@ -65,3 +100,4 @@

extend(_this, ['workdir', 'gitdir', 'remote', 'branch', 'author', 'email', 'datetime', 'depth', 'timestamp', 'signingKey', 'verificationKey', 'outputStream', 'inputStream', 'username', 'password', 'url', 'outputStream', 'inputStream']);
extend(_this, ['workdir', 'gitdir', 'remote', 'branch', 'author', 'email', 'datetime', 'depth', 'since', 'exclude', 'timestamp', 'signingKey', 'verificationKey', 'username', 'password', 'url', 'outputStream', 'inputStream']);
extendBool(_this, ['relative']);
return _this;

@@ -143,3 +179,3 @@ }

value: function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(dir) {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(dir) {
return _regeneratorRuntime.wrap(function _callee$(_context) {

@@ -168,3 +204,3 @@ while (1) {

value: function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2() {
return _regeneratorRuntime.wrap(function _callee2$(_context2) {

@@ -196,3 +232,3 @@ while (1) {

value: function () {
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(ref) {
var _ref3 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee3(ref) {
return _regeneratorRuntime.wrap(function _callee3$(_context3) {

@@ -207,6 +243,9 @@ while (1) {

url: this.get('url'),
depth: this.get('depth'),
remote: this.get('remote'),
authUsername: this.get('username'),
authPassword: this.get('password')
authPassword: this.get('password'),
depth: this.get('depth'),
since: this.get('since'),
exclude: this.get('exclude'),
relative: this.get('relative')
});

@@ -231,3 +270,3 @@

value: function () {
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(ref) {
var _ref4 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee4(ref) {
return _regeneratorRuntime.wrap(function _callee4$(_context4) {

@@ -262,3 +301,3 @@ while (1) {

value: function () {
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(url) {
var _ref5 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee5(url) {
return _regeneratorRuntime.wrap(function _callee5$(_context5) {

@@ -275,5 +314,8 @@ while (1) {

ref: this.get('branch'),
authUsername: this.get('username'),
authPassword: this.get('password'),
depth: this.get('depth'),
authUsername: this.get('username'),
authPassword: this.get('password')
since: this.get('since'),
exclude: this.get('exclude'),
relative: this.get('relative')
});

@@ -298,3 +340,3 @@

value: function () {
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
var _ref6 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee6() {
return _regeneratorRuntime.wrap(function _callee6$(_context6) {

@@ -325,3 +367,3 @@ while (1) {

value: function () {
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(filepath) {
var _ref7 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee7(filepath) {
return _regeneratorRuntime.wrap(function _callee7$(_context7) {

@@ -354,3 +396,3 @@ while (1) {

value: function () {
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(filepath) {
var _ref8 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee8(filepath) {
return _regeneratorRuntime.wrap(function _callee8$(_context8) {

@@ -382,3 +424,3 @@ while (1) {

value: function () {
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(message) {
var _ref9 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee9(message) {
return _regeneratorRuntime.wrap(function _callee9$(_context9) {

@@ -423,3 +465,3 @@ while (1) {

value: function () {
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(ref) {
var _ref10 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee10(ref) {
return _regeneratorRuntime.wrap(function _callee10$(_context10) {

@@ -452,3 +494,3 @@ while (1) {

value: function () {
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(oids) {
var _ref11 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee11(oids) {
return _regeneratorRuntime.wrap(function _callee11$(_context11) {

@@ -481,3 +523,3 @@ while (1) {

value: function () {
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(oids) {
var _ref12 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee12(oids) {
return _regeneratorRuntime.wrap(function _callee12$(_context12) {

@@ -509,3 +551,3 @@ while (1) {

value: function () {
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(ref) {
var _ref13 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee13(ref) {
return _regeneratorRuntime.wrap(function _callee13$(_context13) {

@@ -541,3 +583,3 @@ while (1) {

value: function () {
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(ref) {
var _ref14 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee14(ref) {
return _regeneratorRuntime.wrap(function _callee14$(_context14) {

@@ -572,3 +614,3 @@ while (1) {

value: function () {
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(path, value) {
var _ref15 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee15(path, value) {
var _args15 = arguments;

@@ -613,3 +655,3 @@ return _regeneratorRuntime.wrap(function _callee15$(_context15) {

value: function () {
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(pathname) {
var _ref16 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee16(pathname) {
return _regeneratorRuntime.wrap(function _callee16$(_context16) {

@@ -642,3 +684,3 @@ while (1) {

value: function () {
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17() {
var _ref17 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee17() {
return _regeneratorRuntime.wrap(function _callee17$(_context17) {

@@ -645,0 +687,0 @@ while (1) {

@@ -36,3 +36,3 @@ 'use strict';

value: function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(_ref) {
var gitdir = _ref.gitdir;

@@ -68,3 +68,3 @@ var text;

value: function () {
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
var _ref4 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(_ref3) {
var gitdir = _ref3.gitdir,

@@ -110,3 +110,3 @@ config = _ref3.config;

value: function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(_ref) {
var gitdir = _ref.gitdir;

@@ -155,3 +155,3 @@ var oids, text;

value: function () {
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref3) {
var _ref4 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(_ref3) {
var gitdir = _ref3.gitdir,

@@ -252,3 +252,3 @@ oids = _ref3.oids;

value: function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(filepath, closure) {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(filepath, closure) {
return _regeneratorRuntime.wrap(function _callee2$(_context2) {

@@ -259,3 +259,3 @@ while (1) {

_context2.next = 2;
return lock.acquire(filepath, _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
return lock.acquire(filepath, _asyncToGenerator(_regeneratorRuntime.mark(function _callee() {
var index, rawIndexFile, buffer$$1;

@@ -387,3 +387,3 @@ return _regeneratorRuntime.wrap(function _callee$(_context) {

value: function () {
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref3 /*: {gitdir: string, oid: string} */) {
var _ref4 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(_ref3 /*: {gitdir: string, oid: string} */) {
var gitdir = _ref3.gitdir,

@@ -432,3 +432,3 @@ oid = _ref3.oid;

value: function () {
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(_ref5) {
var _ref6 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(_ref5) {
var gitdir = _ref5.gitdir,

@@ -463,3 +463,3 @@ type = _ref5.type,

value: function () {
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref7) {
var _ref8 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee3(_ref7) {
var gitdir = _ref7.gitdir,

@@ -535,3 +535,3 @@ type = _ref7.type,

value: function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(_ref) {
var gitdir = _ref.gitdir,

@@ -817,3 +817,3 @@ remote = _ref.remote,

value: function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee() {
return _regeneratorRuntime.wrap(function _callee$(_context) {

@@ -843,3 +843,3 @@ while (1) {

value: function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2() {
return _regeneratorRuntime.wrap(function _callee2$(_context2) {

@@ -869,3 +869,3 @@ while (1) {

value: function () {
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(service /*: string */) {
var _ref3 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee3(service /*: string */) {
var _this = this;

@@ -1050,3 +1050,3 @@

value: function () {
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(stream$$1 /*: ReadableStream */) {
var _ref5 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee4(stream$$1 /*: ReadableStream */) {
var service, res;

@@ -1082,3 +1082,3 @@ return _regeneratorRuntime.wrap(function _callee4$(_context4) {

value: function () {
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(stream$$1 /*: ReadableStream */) {
var _ref6 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee5(stream$$1 /*: ReadableStream */) {
var service, res;

@@ -1114,3 +1114,3 @@ return _regeneratorRuntime.wrap(function _callee5$(_context5) {

value: function () {
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(_ref7) {
var _ref8 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee7(_ref7) {
var _stream = _ref7.stream,

@@ -1160,3 +1160,3 @@ service = _ref7.service;

nextBit = function () {
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6() {
var _ref9 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee6() {
var line, error;

@@ -1163,0 +1163,0 @@ return _regeneratorRuntime.wrap(function _callee6$(_context6) {

@@ -228,3 +228,3 @@ 'use strict';

value: function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(privateKeys /*: string */) {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(privateKeys /*: string */) {
var commit, headers, message$$1, privKeyObj, _ref2, signature, signedCommit;

@@ -276,3 +276,3 @@

value: function () {
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
var _ref3 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2() {
var msg;

@@ -305,3 +305,3 @@ return _regeneratorRuntime.wrap(function _callee2$(_context2) {

value: function () {
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(publicKeys /*: string */) {
var _ref4 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee3(publicKeys /*: string */) {
var pubKeyObj, msg, results, validity;

@@ -477,3 +477,3 @@ return _regeneratorRuntime.wrap(function _callee3$(_context3) {

value: function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(path) {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(path) {
return _regeneratorRuntime.wrap(function _callee$(_context) {

@@ -502,3 +502,3 @@ while (1) {

value: function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(path, value) {
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(path, value) {
return _regeneratorRuntime.wrap(function _callee2$(_context2) {

@@ -684,3 +684,3 @@ while (1) {

return function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee() {
var hexlength, length, bytes;

@@ -863,3 +863,3 @@ return _regeneratorRuntime.wrap(function _callee$(_context) {

key: _Symbol$iterator,
value: /*#__PURE__*/_regeneratorRuntime.mark(function value() {
value: _regeneratorRuntime.mark(function value() {
var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, entry;

@@ -1154,3 +1154,3 @@

key: _Symbol$iterator,
value: /*#__PURE__*/_regeneratorRuntime.mark(function value() {
value: _regeneratorRuntime.mark(function value() {
var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, entry;

@@ -1157,0 +1157,0 @@

@@ -21,3 +21,3 @@ 'use strict';

var rm = function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filepath) {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(filepath) {
return _regeneratorRuntime.wrap(function _callee$(_context) {

@@ -61,3 +61,3 @@ while (1) {

var exists = function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file, options) {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(file, options) {
return _regeneratorRuntime.wrap(function _callee$(_context) {

@@ -167,3 +167,3 @@ while (1) {

var sleep = function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(ms) {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(ms) {
return _regeneratorRuntime.wrap(function _callee$(_context) {

@@ -195,3 +195,3 @@ while (1) {

var lock = function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filename /*: string */
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(filename /*: string */
) {

@@ -259,3 +259,3 @@ var triesLeft /*: number */ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;

var unlock = function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(filename /*: string */
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee3(filename /*: string */
) {

@@ -278,3 +278,3 @@ var _this = this;

// But really we wait a bit to see if you want to acquire it again.
delayedReleases.set(filename, setTimeout(_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
delayedReleases.set(filename, setTimeout(_asyncToGenerator(_regeneratorRuntime.mark(function _callee2() {
return _regeneratorRuntime.wrap(function _callee2$(_context2) {

@@ -311,3 +311,3 @@ while (1) {

var mkdir = function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(dirpath /*: string */) {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(dirpath /*: string */) {
var parent;

@@ -382,3 +382,3 @@ return _regeneratorRuntime.wrap(function _callee$(_context) {

var mkdirs = function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(dirlist /*: string[] */) {
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee2(dirlist /*: string[] */) {
return _regeneratorRuntime.wrap(function _callee2$(_context2) {

@@ -405,3 +405,3 @@ while (1) {

var read = function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(file, options) {
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(file, options) {
return _regeneratorRuntime.wrap(function _callee$(_context) {

@@ -431,3 +431,3 @@ while (1) {

var resolveRef = function () {
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
var _ref2 = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(_ref) {
var gitdir = _ref.gitdir,

@@ -575,3 +575,3 @@ ref = _ref.ref,

var write = function () {
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(filepath /*: string */
var _ref = _asyncToGenerator(_regeneratorRuntime.mark(function _callee(filepath /*: string */
, contents /*: string|Buffer */

@@ -615,3 +615,3 @@ ) {

var name = "isomorphic-git";
var version = "0.0.17";
var version = "0.0.18";
var description = "A pure JavaScript implementation of git for node and browsers!";

@@ -618,0 +618,0 @@ var main = "dist/for-node/";

@@ -167,5 +167,13 @@ import path from 'path';

authPassword,
depth = 0
depth = null,
since = null,
exclude = [],
relative = false
}) {
depth = parseInt(depth);
if (depth !== null) {
if (Number.isNaN(parseInt(depth))) {
throw new Error(`Invalid value for depth argument: ${depth}`);
}
depth = parseInt(depth);
}
remote = remote || 'origin';

@@ -187,5 +195,14 @@ if (url === undefined) {

// Check server supports shallow cloning
if (depth > 0 && !remoteHTTP.capabilities.has('shallow')) {
throw new Error(`Remote does not support shallow fetching`);
if (depth !== null && !remoteHTTP.capabilities.has('shallow')) {
throw new Error(`Remote does not support shallow fetches`);
}
if (since !== null && !remoteHTTP.capabilities.has('deepen-since')) {
throw new Error(`Remote does not support shallow fetches by date`);
}
if (exclude.length > 0 && !remoteHTTP.capabilities.has('deepen-not')) {
throw new Error(`Remote does not support shallow fetches excluding commits reachable by refs`);
}
if (relative === true && !remoteHTTP.capabilities.has('deepen-relative')) {
throw new Error(`Remote does not support shallow fetches relative to the current shallow depth`);
}
await GitRefsManager.updateRemoteRefs({

@@ -200,3 +217,3 @@ gitdir,

// Github uses all ref-deltas when I fetch packfiles instead of all ofs-deltas. Nice!
const capabilities = `multi_ack_detailed no-done side-band-64k thin-pack agent=git/${pkg.name}@${pkg.version}`;
const capabilities = `multi_ack_detailed no-done side-band-64k thin-pack agent=git/${pkg.name}@${pkg.version}${relative ? ' deepen-relative' : ''}`;
let packstream = new stream.PassThrough();

@@ -210,5 +227,11 @@ packstream.write(GitPktLine.encode(`want ${want} ${capabilities}\n`));

}
if (depth !== 0) {
packstream.write(GitPktLine.encode(`deepen ${parseInt(depth)}\n`));
if (depth !== null) {
packstream.write(GitPktLine.encode(`deepen ${depth}\n`));
}
if (since !== null) {
packstream.write(GitPktLine.encode(`deepen-since ${Math.floor(since.valueOf() / 1000)}\n`));
}
for (let x of exclude) {
packstream.write(GitPktLine.encode(`deepen-not ${x}\n`));
}
packstream.write(GitPktLine.flush());

@@ -254,3 +277,6 @@ let have = null;

authPassword,
depth = 0
depth,
since,
exclude,
relative
}) {

@@ -264,3 +290,6 @@ let response = await fetchPackfile({

authPassword,
depth
depth,
since,
exclude,
relative
});

@@ -360,5 +389,8 @@ response.progress.on('data', data => console.log(data.toString('utf8')));

ref,
authUsername,
authPassword,
depth,
authUsername,
authPassword
since,
exclude,
relative
}) {

@@ -377,6 +409,9 @@ remote = remote || 'origin';

ref,
depth,
remote,
authUsername,
authPassword
authPassword,
depth,
since,
exclude,
relative
});

@@ -852,3 +887,3 @@ // Checkout branch

var version$1 = "0.0.17";
var version$1 = "0.0.18";

@@ -855,0 +890,0 @@ function version() {

@@ -13,2 +13,10 @@ import { add, checkout, clone, commit, config, fetch, findRoot, init, list, listBranches, pack, push, remove, status, unpack, verify, version } from './commands.js';

// This is so git().relative() is the same as git().relative(true)
// but you can still undo the flag later with git().relative(false)
const extendBool = (self, array) => {
for (let fn of array) {
self[fn] = val => self.set(fn, val !== false);
}
};
// The class is merely a fluent command/query builder

@@ -19,3 +27,4 @@ class Git extends Map {

super(parent);
extend(this, ['workdir', 'gitdir', 'remote', 'branch', 'author', 'email', 'datetime', 'depth', 'timestamp', 'signingKey', 'verificationKey', 'outputStream', 'inputStream', 'username', 'password', 'url', 'outputStream', 'inputStream']);
extend(this, ['workdir', 'gitdir', 'remote', 'branch', 'author', 'email', 'datetime', 'depth', 'since', 'exclude', 'timestamp', 'signingKey', 'verificationKey', 'username', 'password', 'url', 'outputStream', 'inputStream']);
extendBool(this, ['relative']);
}

@@ -97,6 +106,9 @@ version() {

url: this.get('url'),
depth: this.get('depth'),
remote: this.get('remote'),
authUsername: this.get('username'),
authPassword: this.get('password')
authPassword: this.get('password'),
depth: this.get('depth'),
since: this.get('since'),
exclude: this.get('exclude'),
relative: this.get('relative')
});

@@ -119,5 +131,8 @@ }

ref: this.get('branch'),
authUsername: this.get('username'),
authPassword: this.get('password'),
depth: this.get('depth'),
authUsername: this.get('username'),
authPassword: this.get('password')
since: this.get('since'),
exclude: this.get('exclude'),
relative: this.get('relative')
});

@@ -124,0 +139,0 @@ }

@@ -216,3 +216,3 @@ import systemfs from 'fs';

var name = "isomorphic-git";
var version = "0.0.17";
var version = "0.0.18";
var description = "A pure JavaScript implementation of git for node and browsers!";

@@ -219,0 +219,0 @@ var main = "dist/for-node/";

@@ -173,5 +173,13 @@ 'use strict';

authPassword,
depth = 0
depth = null,
since = null,
exclude = [],
relative = false
}) {
depth = parseInt(depth);
if (depth !== null) {
if (Number.isNaN(parseInt(depth))) {
throw new Error(`Invalid value for depth argument: ${depth}`);
}
depth = parseInt(depth);
}
remote = remote || 'origin';

@@ -193,5 +201,14 @@ if (url === undefined) {

// Check server supports shallow cloning
if (depth > 0 && !remoteHTTP.capabilities.has('shallow')) {
throw new Error(`Remote does not support shallow fetching`);
if (depth !== null && !remoteHTTP.capabilities.has('shallow')) {
throw new Error(`Remote does not support shallow fetches`);
}
if (since !== null && !remoteHTTP.capabilities.has('deepen-since')) {
throw new Error(`Remote does not support shallow fetches by date`);
}
if (exclude.length > 0 && !remoteHTTP.capabilities.has('deepen-not')) {
throw new Error(`Remote does not support shallow fetches excluding commits reachable by refs`);
}
if (relative === true && !remoteHTTP.capabilities.has('deepen-relative')) {
throw new Error(`Remote does not support shallow fetches relative to the current shallow depth`);
}
await managers_js.GitRefsManager.updateRemoteRefs({

@@ -206,3 +223,3 @@ gitdir,

// Github uses all ref-deltas when I fetch packfiles instead of all ofs-deltas. Nice!
const capabilities = `multi_ack_detailed no-done side-band-64k thin-pack agent=git/${utils_js.pkg.name}@${utils_js.pkg.version}`;
const capabilities = `multi_ack_detailed no-done side-band-64k thin-pack agent=git/${utils_js.pkg.name}@${utils_js.pkg.version}${relative ? ' deepen-relative' : ''}`;
let packstream = new stream.PassThrough();

@@ -216,5 +233,11 @@ packstream.write(models_js.GitPktLine.encode(`want ${want} ${capabilities}\n`));

}
if (depth !== 0) {
packstream.write(models_js.GitPktLine.encode(`deepen ${parseInt(depth)}\n`));
if (depth !== null) {
packstream.write(models_js.GitPktLine.encode(`deepen ${depth}\n`));
}
if (since !== null) {
packstream.write(models_js.GitPktLine.encode(`deepen-since ${Math.floor(since.valueOf() / 1000)}\n`));
}
for (let x of exclude) {
packstream.write(models_js.GitPktLine.encode(`deepen-not ${x}\n`));
}
packstream.write(models_js.GitPktLine.flush());

@@ -260,3 +283,6 @@ let have = null;

authPassword,
depth = 0
depth,
since,
exclude,
relative
}) {

@@ -270,3 +296,6 @@ let response = await fetchPackfile({

authPassword,
depth
depth,
since,
exclude,
relative
});

@@ -366,5 +395,8 @@ response.progress.on('data', data => console.log(data.toString('utf8')));

ref,
authUsername,
authPassword,
depth,
authUsername,
authPassword
since,
exclude,
relative
}) {

@@ -383,6 +415,9 @@ remote = remote || 'origin';

ref,
depth,
remote,
authUsername,
authPassword
authPassword,
depth,
since,
exclude,
relative
});

@@ -858,3 +893,3 @@ // Checkout branch

var version$1 = "0.0.17";
var version$1 = "0.0.18";

@@ -861,0 +896,0 @@ function version() {

@@ -15,2 +15,10 @@ 'use strict';

// This is so git().relative() is the same as git().relative(true)
// but you can still undo the flag later with git().relative(false)
const extendBool = (self, array) => {
for (let fn of array) {
self[fn] = val => self.set(fn, val !== false);
}
};
// The class is merely a fluent command/query builder

@@ -21,3 +29,4 @@ class Git extends Map {

super(parent);
extend(this, ['workdir', 'gitdir', 'remote', 'branch', 'author', 'email', 'datetime', 'depth', 'timestamp', 'signingKey', 'verificationKey', 'outputStream', 'inputStream', 'username', 'password', 'url', 'outputStream', 'inputStream']);
extend(this, ['workdir', 'gitdir', 'remote', 'branch', 'author', 'email', 'datetime', 'depth', 'since', 'exclude', 'timestamp', 'signingKey', 'verificationKey', 'username', 'password', 'url', 'outputStream', 'inputStream']);
extendBool(this, ['relative']);
}

@@ -99,6 +108,9 @@ version() {

url: this.get('url'),
depth: this.get('depth'),
remote: this.get('remote'),
authUsername: this.get('username'),
authPassword: this.get('password')
authPassword: this.get('password'),
depth: this.get('depth'),
since: this.get('since'),
exclude: this.get('exclude'),
relative: this.get('relative')
});

@@ -121,5 +133,8 @@ }

ref: this.get('branch'),
authUsername: this.get('username'),
authPassword: this.get('password'),
depth: this.get('depth'),
authUsername: this.get('username'),
authPassword: this.get('password')
since: this.get('since'),
exclude: this.get('exclude'),
relative: this.get('relative')
});

@@ -126,0 +141,0 @@ }

@@ -222,3 +222,3 @@ 'use strict';

var name = "isomorphic-git";
var version = "0.0.17";
var version = "0.0.18";
var description = "A pure JavaScript implementation of git for node and browsers!";

@@ -225,0 +225,0 @@ var main = "dist/for-node/";

{
"name": "isomorphic-git",
"version": "0.0.17",
"version": "0.0.18",
"description": "A pure JavaScript implementation of git for node and browsers!",

@@ -5,0 +5,0 @@ "main": "dist/for-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) [![Greenkeeper badge](https://badges.greenkeeper.io/wmhilton/isomorphic-git.svg)](https://greenkeeper.io/)
# 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)
A pure JavaScript implementation of git for node and browsers!

@@ -218,6 +218,9 @@

.gitdir(gitdir)
.depth(depth)
.branch(ref)
.auth(authUsername, authPassword)
.remote(remote)
.depth(depth)
.since(since)
.exclude(exclude)
.relative(relative)
.clone(url)

@@ -228,3 +231,2 @@ ```

- @param {string} `gitdir` - The path to the git directory.
- @param {integer} [`depth=0`] - Determines how much of the git repository's history to retrieve. If not specified it defaults to 0 which means the entire repo history.
- @param {string} [`ref=undefined`] - Which branch to clone. By default this is the designated "main branch" of the repository.

@@ -235,2 +237,6 @@ - @param {string} [`authUsername=undefined`] - The username to use with Basic Auth

- @param {string} `url` - The URL of the remote repository.
- @param {integer} [`depth=undefined`] - Determines how much of the git repository's history to retrieve.
- @param {Date} [`since=undefined`] - Only fetch commits created after the given date. Mutually exclusive with `depth`.
- @param {string[]} [`exclude=[]`] - A list of branches or tags. Instructs the remote server not to send us any commits reachable from these refs.
- @param {boolean} [`relative=false`] - Changes the meaning of `depth` to be measured from the current shallow depth rather than from the branch tip.
- @returns `Promise<void>`

@@ -259,6 +265,9 @@

.gitdir(gitdir)
.depth(depth)
.auth(authUsername, authPassword)
.url(url)
.remote(remote)
.depth(depth)
.since(since)
.exclude(exclude)
.relative(relative)
.fetch(ref)

@@ -268,3 +277,2 @@ ```

- @param {string} `gitdir` - The path to the git directory.
- @param {integer} [`depth=0`] - Determines how much of the git repository's history to retrieve. If not specified it defaults to 0 which means the entire repo history.
- @param {string} [`ref=undefined`] - Which branch to fetch from. By default this is the currently checked out branch.

@@ -275,2 +283,6 @@ - @param {string} [`authUsername=undefined`] - The username to use with Basic Auth

- @param {string} [`remote='origin'`] - If URL is not specified, determines which remote to use.
- @param {integer} [`depth=undefined`] - Determines how much of the git repository's history to retrieve.
- @param {Date} [`since=undefined`] - Only fetch commits created after the given date. Mutually exclusive with `depth`.
- @param {string[]} [`exclude=[]`] - A list of branches or tags. Instructs the remote server not to send us any commits reachable from these refs.
- @param {boolean} [`relative=false`] - Changes the meaning of `depth` to be measured from the current shallow depth rather than from the branch tip.
- @returns `Promise<void>`

@@ -277,0 +289,0 @@

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 not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc