isomorphic-git 1.18.3 → 1.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/browser-tests.json +2 -2
- package/index.cjs +33 -11
- package/index.d.ts +14 -8
- package/index.js +33 -11
- package/index.umd.min.d.ts +14 -8
- package/index.umd.min.js +1 -1
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/size_report.html +1 -1
package/README.md
CHANGED
|
@@ -346,6 +346,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
|
|
|
346
346
|
<tr>
|
|
347
347
|
<td align="center"><a href="https://github.com/seanpoulter"><img src="https://avatars.githubusercontent.com/u/2585460?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Sean Poulter</b></sub></a><br /><a href="#maintenance-seanpoulter" title="Maintenance">🚧</a></td>
|
|
348
348
|
<td align="center"><a href="https://github.com/araknast"><img src="https://avatars.githubusercontent.com/u/84164531?v=4?s=60" width="60px;" alt=""/><br /><sub><b>araknast</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=araknast" title="Code">💻</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=araknast" title="Tests">⚠️</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=araknast" title="Documentation">📖</a></td>
|
|
349
|
+
<td align="center"><a href="https://github.com/rraab-dev"><img src="https://avatars.githubusercontent.com/u/53948988?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Rafael Raab</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=rraab-dev" title="Code">💻</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=rraab-dev" title="Documentation">📖</a></td>
|
|
349
350
|
</tr>
|
|
350
351
|
</table>
|
|
351
352
|
|
package/browser-tests.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
"Chrome Headless 79.0.3945.0 (Linux x86_64)",
|
|
3
|
-
"Firefox
|
|
3
|
+
"Firefox 103.0 (Ubuntu 0.0.0)",
|
|
4
4
|
"Edge 79.0.309.65 (Windows 10)",
|
|
5
|
-
"Chrome
|
|
5
|
+
"Chrome 103.0.5060.53 (Android 10)",
|
|
6
6
|
"Safari 13.1 (Mac OS 10.15.4)",
|
|
7
7
|
"Mobile Safari 13.0 (iOS 13.0)"
|
|
8
8
|
]
|
package/index.cjs
CHANGED
|
@@ -2712,7 +2712,7 @@ class GitPackIndex {
|
|
|
2712
2712
|
const objectsByDepth = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
2713
2713
|
for (let offset in offsetToObject) {
|
|
2714
2714
|
offset = Number(offset);
|
|
2715
|
-
const percent = Math.floor((count
|
|
2715
|
+
const percent = Math.floor((count * 100) / totalObjectCount);
|
|
2716
2716
|
if (percent !== lastPercent) {
|
|
2717
2717
|
if (onProgress) {
|
|
2718
2718
|
await onProgress({
|
|
@@ -2722,6 +2722,7 @@ class GitPackIndex {
|
|
|
2722
2722
|
});
|
|
2723
2723
|
}
|
|
2724
2724
|
}
|
|
2725
|
+
count++;
|
|
2725
2726
|
lastPercent = percent;
|
|
2726
2727
|
|
|
2727
2728
|
const o = offsetToObject[offset];
|
|
@@ -3918,7 +3919,7 @@ class GitWalkerRepo {
|
|
|
3918
3919
|
* @param {string} [args.ref='HEAD']
|
|
3919
3920
|
* @returns {Walker}
|
|
3920
3921
|
*/
|
|
3921
|
-
function TREE({ ref = 'HEAD' }) {
|
|
3922
|
+
function TREE({ ref = 'HEAD' } = {}) {
|
|
3922
3923
|
const o = Object.create(null);
|
|
3923
3924
|
Object.defineProperty(o, GitWalkSymbol, {
|
|
3924
3925
|
value: function({ fs, gitdir, cache }) {
|
|
@@ -4488,6 +4489,12 @@ function assertParameter(name, value) {
|
|
|
4488
4489
|
}
|
|
4489
4490
|
}
|
|
4490
4491
|
|
|
4492
|
+
function posixifyPathBuffer(buffer) {
|
|
4493
|
+
let idx;
|
|
4494
|
+
while (~(idx = buffer.indexOf(92))) buffer[idx] = 47;
|
|
4495
|
+
return buffer
|
|
4496
|
+
}
|
|
4497
|
+
|
|
4491
4498
|
// @ts-check
|
|
4492
4499
|
|
|
4493
4500
|
/**
|
|
@@ -4564,7 +4571,7 @@ async function addToIndex({ dir, gitdir, fs, filepath, index, force }) {
|
|
|
4564
4571
|
await Promise.all(promises);
|
|
4565
4572
|
} else {
|
|
4566
4573
|
const object = stats.isSymbolicLink()
|
|
4567
|
-
? await fs.readlink(join(dir, currentFilepath))
|
|
4574
|
+
? await fs.readlink(join(dir, currentFilepath)).then(posixifyPathBuffer)
|
|
4568
4575
|
: await fs.read(join(dir, currentFilepath));
|
|
4569
4576
|
if (object === null) throw new NotFoundError(currentFilepath)
|
|
4570
4577
|
const oid = await _writeObject({ fs, gitdir, type: 'blob', object });
|
|
@@ -6983,8 +6990,8 @@ function filterCapabilities(server, client) {
|
|
|
6983
6990
|
|
|
6984
6991
|
const pkg = {
|
|
6985
6992
|
name: 'isomorphic-git',
|
|
6986
|
-
version: '1.
|
|
6987
|
-
agent: 'git/isomorphic-git@1.
|
|
6993
|
+
version: '1.19.2',
|
|
6994
|
+
agent: 'git/isomorphic-git@1.19.2',
|
|
6988
6995
|
};
|
|
6989
6996
|
|
|
6990
6997
|
class FIFO {
|
|
@@ -8948,6 +8955,8 @@ async function _merge({
|
|
|
8948
8955
|
* @param {string} [args.url]
|
|
8949
8956
|
* @param {string} [args.remote]
|
|
8950
8957
|
* @param {string} [args.remoteRef]
|
|
8958
|
+
* @param {boolean} [args.prune]
|
|
8959
|
+
* @param {boolean} [args.pruneTags]
|
|
8951
8960
|
* @param {string} [args.corsProxy]
|
|
8952
8961
|
* @param {boolean} args.singleBranch
|
|
8953
8962
|
* @param {boolean} args.fastForward
|
|
@@ -8983,6 +8992,8 @@ async function _pull({
|
|
|
8983
8992
|
url,
|
|
8984
8993
|
remote,
|
|
8985
8994
|
remoteRef,
|
|
8995
|
+
prune,
|
|
8996
|
+
pruneTags,
|
|
8986
8997
|
fastForward,
|
|
8987
8998
|
fastForwardOnly,
|
|
8988
8999
|
corsProxy,
|
|
@@ -9020,6 +9031,8 @@ async function _pull({
|
|
|
9020
9031
|
remoteRef,
|
|
9021
9032
|
singleBranch,
|
|
9022
9033
|
headers,
|
|
9034
|
+
prune,
|
|
9035
|
+
pruneTags,
|
|
9023
9036
|
});
|
|
9024
9037
|
// Merge the remote tracking branch into the local one.
|
|
9025
9038
|
await _merge({
|
|
@@ -9185,8 +9198,8 @@ async function fastForward({
|
|
|
9185
9198
|
* @param {boolean} [args.relative = false] - Changes the meaning of `depth` to be measured from the current shallow depth rather than from the branch tip.
|
|
9186
9199
|
* @param {Date} [args.since] - Only fetch commits created after the given date. Mutually exclusive with `depth`.
|
|
9187
9200
|
* @param {string[]} [args.exclude = []] - A list of branches or tags. Instructs the remote server not to send us any commits reachable from these refs.
|
|
9188
|
-
* @param {boolean} [args.prune] - Delete local remote-tracking branches that are not present on the remote
|
|
9189
|
-
* @param {boolean} [args.pruneTags] - Prune local tags that don’t exist on the remote, and force-update those tags that differ
|
|
9201
|
+
* @param {boolean} [args.prune = false] - Delete local remote-tracking branches that are not present on the remote
|
|
9202
|
+
* @param {boolean} [args.pruneTags = false] - Prune local tags that don’t exist on the remote, and force-update those tags that differ
|
|
9190
9203
|
* @param {string} [args.corsProxy] - Optional [CORS proxy](https://www.npmjs.com/%40isomorphic-git/cors-proxy). Overrides value in repo config.
|
|
9191
9204
|
* @param {Object<string, string>} [args.headers] - Additional headers to include in HTTP requests, similar to git's `extraHeader` config
|
|
9192
9205
|
* @param {object} [args.cache] - a [cache](cache.md) object
|
|
@@ -11342,6 +11355,8 @@ async function packObjects({
|
|
|
11342
11355
|
* @param {string} [args.url] - (Added in 1.1.0) The URL of the remote repository. The default is the value set in the git config for that remote.
|
|
11343
11356
|
* @param {string} [args.remote] - (Added in 1.1.0) If URL is not specified, determines which remote to use.
|
|
11344
11357
|
* @param {string} [args.remoteRef] - (Added in 1.1.0) The name of the branch on the remote to fetch. By default this is the configured remote tracking branch.
|
|
11358
|
+
* @param {boolean} [args.prune = false] - Delete local remote-tracking branches that are not present on the remote
|
|
11359
|
+
* @param {boolean} [args.pruneTags = false] - Prune local tags that don’t exist on the remote, and force-update those tags that differ
|
|
11345
11360
|
* @param {string} [args.corsProxy] - Optional [CORS proxy](https://www.npmjs.com/%40isomorphic-git/cors-proxy). Overrides value in repo config.
|
|
11346
11361
|
* @param {boolean} [args.singleBranch = false] - Instead of the default behavior of fetching all the branches, only fetch a single branch.
|
|
11347
11362
|
* @param {boolean} [args.fastForward = true] - If false, only create merge commits.
|
|
@@ -11387,6 +11402,8 @@ async function pull({
|
|
|
11387
11402
|
url,
|
|
11388
11403
|
remote,
|
|
11389
11404
|
remoteRef,
|
|
11405
|
+
prune = false,
|
|
11406
|
+
pruneTags = false,
|
|
11390
11407
|
fastForward = true,
|
|
11391
11408
|
fastForwardOnly = false,
|
|
11392
11409
|
corsProxy,
|
|
@@ -11437,6 +11454,8 @@ async function pull({
|
|
|
11437
11454
|
author,
|
|
11438
11455
|
committer,
|
|
11439
11456
|
signingKey,
|
|
11457
|
+
prune,
|
|
11458
|
+
pruneTags,
|
|
11440
11459
|
})
|
|
11441
11460
|
} catch (err) {
|
|
11442
11461
|
err.caller = 'git.pull';
|
|
@@ -11800,6 +11819,7 @@ async function _push({
|
|
|
11800
11819
|
}
|
|
11801
11820
|
}
|
|
11802
11821
|
|
|
11822
|
+
if (oid === oldoid) force = true;
|
|
11803
11823
|
if (!force) {
|
|
11804
11824
|
// Is it a tag that already exists?
|
|
11805
11825
|
if (
|
|
@@ -14019,12 +14039,14 @@ function version() {
|
|
|
14019
14039
|
*
|
|
14020
14040
|
* Example 2: Return the difference between the working directory and the HEAD commit
|
|
14021
14041
|
* ```js
|
|
14022
|
-
* const
|
|
14023
|
-
* async function map(filepath, [head, workdir]) {
|
|
14042
|
+
* const map = async (filepath, [head, workdir]) => {
|
|
14024
14043
|
* return {
|
|
14025
14044
|
* filepath,
|
|
14026
|
-
* oid: await head
|
|
14027
|
-
* diff: diff(
|
|
14045
|
+
* oid: await head?.oid(),
|
|
14046
|
+
* diff: diff(
|
|
14047
|
+
* (await head?.content())?.toString('utf8') || '',
|
|
14048
|
+
* (await workdir?.content())?.toString('utf8') || ''
|
|
14049
|
+
* )
|
|
14028
14050
|
* }
|
|
14029
14051
|
* }
|
|
14030
14052
|
* ```
|
package/index.d.ts
CHANGED
|
@@ -752,7 +752,7 @@ export function STAGE(): Walker;
|
|
|
752
752
|
* @param {string} [args.ref='HEAD']
|
|
753
753
|
* @returns {Walker}
|
|
754
754
|
*/
|
|
755
|
-
export function TREE({ ref }
|
|
755
|
+
export function TREE({ ref }?: {
|
|
756
756
|
ref?: string;
|
|
757
757
|
}): Walker;
|
|
758
758
|
/**
|
|
@@ -1406,8 +1406,8 @@ export function fastForward({ fs, http, onProgress, onMessage, onAuth, onAuthSuc
|
|
|
1406
1406
|
* @param {boolean} [args.relative = false] - Changes the meaning of `depth` to be measured from the current shallow depth rather than from the branch tip.
|
|
1407
1407
|
* @param {Date} [args.since] - Only fetch commits created after the given date. Mutually exclusive with `depth`.
|
|
1408
1408
|
* @param {string[]} [args.exclude = []] - A list of branches or tags. Instructs the remote server not to send us any commits reachable from these refs.
|
|
1409
|
-
* @param {boolean} [args.prune] - Delete local remote-tracking branches that are not present on the remote
|
|
1410
|
-
* @param {boolean} [args.pruneTags] - Prune local tags that don’t exist on the remote, and force-update those tags that differ
|
|
1409
|
+
* @param {boolean} [args.prune = false] - Delete local remote-tracking branches that are not present on the remote
|
|
1410
|
+
* @param {boolean} [args.pruneTags = false] - Prune local tags that don’t exist on the remote, and force-update those tags that differ
|
|
1411
1411
|
* @param {string} [args.corsProxy] - Optional [CORS proxy](https://www.npmjs.com/%40isomorphic-git/cors-proxy). Overrides value in repo config.
|
|
1412
1412
|
* @param {Object<string, string>} [args.headers] - Additional headers to include in HTTP requests, similar to git's `extraHeader` config
|
|
1413
1413
|
* @param {object} [args.cache] - a [cache](cache.md) object
|
|
@@ -2279,6 +2279,8 @@ export function packObjects({ fs, dir, gitdir, oids, write, cache, }: {
|
|
|
2279
2279
|
* @param {string} [args.url] - (Added in 1.1.0) The URL of the remote repository. The default is the value set in the git config for that remote.
|
|
2280
2280
|
* @param {string} [args.remote] - (Added in 1.1.0) If URL is not specified, determines which remote to use.
|
|
2281
2281
|
* @param {string} [args.remoteRef] - (Added in 1.1.0) The name of the branch on the remote to fetch. By default this is the configured remote tracking branch.
|
|
2282
|
+
* @param {boolean} [args.prune = false] - Delete local remote-tracking branches that are not present on the remote
|
|
2283
|
+
* @param {boolean} [args.pruneTags = false] - Prune local tags that don’t exist on the remote, and force-update those tags that differ
|
|
2282
2284
|
* @param {string} [args.corsProxy] - Optional [CORS proxy](https://www.npmjs.com/%40isomorphic-git/cors-proxy). Overrides value in repo config.
|
|
2283
2285
|
* @param {boolean} [args.singleBranch = false] - Instead of the default behavior of fetching all the branches, only fetch a single branch.
|
|
2284
2286
|
* @param {boolean} [args.fastForward = true] - If false, only create merge commits.
|
|
@@ -2310,7 +2312,7 @@ export function packObjects({ fs, dir, gitdir, oids, write, cache, }: {
|
|
|
2310
2312
|
* console.log('done')
|
|
2311
2313
|
*
|
|
2312
2314
|
*/
|
|
2313
|
-
export function pull({ fs: _fs, http, onProgress, onMessage, onAuth, onAuthSuccess, onAuthFailure, dir, gitdir, ref, url, remote, remoteRef, fastForward, fastForwardOnly, corsProxy, singleBranch, headers, author: _author, committer: _committer, signingKey, cache, }: {
|
|
2315
|
+
export function pull({ fs: _fs, http, onProgress, onMessage, onAuth, onAuthSuccess, onAuthFailure, dir, gitdir, ref, url, remote, remoteRef, prune, pruneTags, fastForward, fastForwardOnly, corsProxy, singleBranch, headers, author: _author, committer: _committer, signingKey, cache, }: {
|
|
2314
2316
|
fs: CallbackFsClient | PromiseFsClient;
|
|
2315
2317
|
http: HttpClient;
|
|
2316
2318
|
onProgress?: ProgressCallback;
|
|
@@ -2324,6 +2326,8 @@ export function pull({ fs: _fs, http, onProgress, onMessage, onAuth, onAuthSucce
|
|
|
2324
2326
|
url?: string;
|
|
2325
2327
|
remote?: string;
|
|
2326
2328
|
remoteRef?: string;
|
|
2329
|
+
prune?: boolean;
|
|
2330
|
+
pruneTags?: boolean;
|
|
2327
2331
|
corsProxy?: string;
|
|
2328
2332
|
singleBranch?: boolean;
|
|
2329
2333
|
fastForward?: boolean;
|
|
@@ -3411,12 +3415,14 @@ export function version(): string;
|
|
|
3411
3415
|
*
|
|
3412
3416
|
* Example 2: Return the difference between the working directory and the HEAD commit
|
|
3413
3417
|
* ```js
|
|
3414
|
-
* const
|
|
3415
|
-
* async function map(filepath, [head, workdir]) {
|
|
3418
|
+
* const map = async (filepath, [head, workdir]) => {
|
|
3416
3419
|
* return {
|
|
3417
3420
|
* filepath,
|
|
3418
|
-
* oid: await head
|
|
3419
|
-
* diff: diff(
|
|
3421
|
+
* oid: await head?.oid(),
|
|
3422
|
+
* diff: diff(
|
|
3423
|
+
* (await head?.content())?.toString('utf8') || '',
|
|
3424
|
+
* (await workdir?.content())?.toString('utf8') || ''
|
|
3425
|
+
* )
|
|
3420
3426
|
* }
|
|
3421
3427
|
* }
|
|
3422
3428
|
* ```
|
package/index.js
CHANGED
|
@@ -2706,7 +2706,7 @@ class GitPackIndex {
|
|
|
2706
2706
|
const objectsByDepth = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
2707
2707
|
for (let offset in offsetToObject) {
|
|
2708
2708
|
offset = Number(offset);
|
|
2709
|
-
const percent = Math.floor((count
|
|
2709
|
+
const percent = Math.floor((count * 100) / totalObjectCount);
|
|
2710
2710
|
if (percent !== lastPercent) {
|
|
2711
2711
|
if (onProgress) {
|
|
2712
2712
|
await onProgress({
|
|
@@ -2716,6 +2716,7 @@ class GitPackIndex {
|
|
|
2716
2716
|
});
|
|
2717
2717
|
}
|
|
2718
2718
|
}
|
|
2719
|
+
count++;
|
|
2719
2720
|
lastPercent = percent;
|
|
2720
2721
|
|
|
2721
2722
|
const o = offsetToObject[offset];
|
|
@@ -3912,7 +3913,7 @@ class GitWalkerRepo {
|
|
|
3912
3913
|
* @param {string} [args.ref='HEAD']
|
|
3913
3914
|
* @returns {Walker}
|
|
3914
3915
|
*/
|
|
3915
|
-
function TREE({ ref = 'HEAD' }) {
|
|
3916
|
+
function TREE({ ref = 'HEAD' } = {}) {
|
|
3916
3917
|
const o = Object.create(null);
|
|
3917
3918
|
Object.defineProperty(o, GitWalkSymbol, {
|
|
3918
3919
|
value: function({ fs, gitdir, cache }) {
|
|
@@ -4482,6 +4483,12 @@ function assertParameter(name, value) {
|
|
|
4482
4483
|
}
|
|
4483
4484
|
}
|
|
4484
4485
|
|
|
4486
|
+
function posixifyPathBuffer(buffer) {
|
|
4487
|
+
let idx;
|
|
4488
|
+
while (~(idx = buffer.indexOf(92))) buffer[idx] = 47;
|
|
4489
|
+
return buffer
|
|
4490
|
+
}
|
|
4491
|
+
|
|
4485
4492
|
// @ts-check
|
|
4486
4493
|
|
|
4487
4494
|
/**
|
|
@@ -4558,7 +4565,7 @@ async function addToIndex({ dir, gitdir, fs, filepath, index, force }) {
|
|
|
4558
4565
|
await Promise.all(promises);
|
|
4559
4566
|
} else {
|
|
4560
4567
|
const object = stats.isSymbolicLink()
|
|
4561
|
-
? await fs.readlink(join(dir, currentFilepath))
|
|
4568
|
+
? await fs.readlink(join(dir, currentFilepath)).then(posixifyPathBuffer)
|
|
4562
4569
|
: await fs.read(join(dir, currentFilepath));
|
|
4563
4570
|
if (object === null) throw new NotFoundError(currentFilepath)
|
|
4564
4571
|
const oid = await _writeObject({ fs, gitdir, type: 'blob', object });
|
|
@@ -6977,8 +6984,8 @@ function filterCapabilities(server, client) {
|
|
|
6977
6984
|
|
|
6978
6985
|
const pkg = {
|
|
6979
6986
|
name: 'isomorphic-git',
|
|
6980
|
-
version: '1.
|
|
6981
|
-
agent: 'git/isomorphic-git@1.
|
|
6987
|
+
version: '1.19.2',
|
|
6988
|
+
agent: 'git/isomorphic-git@1.19.2',
|
|
6982
6989
|
};
|
|
6983
6990
|
|
|
6984
6991
|
class FIFO {
|
|
@@ -8942,6 +8949,8 @@ async function _merge({
|
|
|
8942
8949
|
* @param {string} [args.url]
|
|
8943
8950
|
* @param {string} [args.remote]
|
|
8944
8951
|
* @param {string} [args.remoteRef]
|
|
8952
|
+
* @param {boolean} [args.prune]
|
|
8953
|
+
* @param {boolean} [args.pruneTags]
|
|
8945
8954
|
* @param {string} [args.corsProxy]
|
|
8946
8955
|
* @param {boolean} args.singleBranch
|
|
8947
8956
|
* @param {boolean} args.fastForward
|
|
@@ -8977,6 +8986,8 @@ async function _pull({
|
|
|
8977
8986
|
url,
|
|
8978
8987
|
remote,
|
|
8979
8988
|
remoteRef,
|
|
8989
|
+
prune,
|
|
8990
|
+
pruneTags,
|
|
8980
8991
|
fastForward,
|
|
8981
8992
|
fastForwardOnly,
|
|
8982
8993
|
corsProxy,
|
|
@@ -9014,6 +9025,8 @@ async function _pull({
|
|
|
9014
9025
|
remoteRef,
|
|
9015
9026
|
singleBranch,
|
|
9016
9027
|
headers,
|
|
9028
|
+
prune,
|
|
9029
|
+
pruneTags,
|
|
9017
9030
|
});
|
|
9018
9031
|
// Merge the remote tracking branch into the local one.
|
|
9019
9032
|
await _merge({
|
|
@@ -9179,8 +9192,8 @@ async function fastForward({
|
|
|
9179
9192
|
* @param {boolean} [args.relative = false] - Changes the meaning of `depth` to be measured from the current shallow depth rather than from the branch tip.
|
|
9180
9193
|
* @param {Date} [args.since] - Only fetch commits created after the given date. Mutually exclusive with `depth`.
|
|
9181
9194
|
* @param {string[]} [args.exclude = []] - A list of branches or tags. Instructs the remote server not to send us any commits reachable from these refs.
|
|
9182
|
-
* @param {boolean} [args.prune] - Delete local remote-tracking branches that are not present on the remote
|
|
9183
|
-
* @param {boolean} [args.pruneTags] - Prune local tags that don’t exist on the remote, and force-update those tags that differ
|
|
9195
|
+
* @param {boolean} [args.prune = false] - Delete local remote-tracking branches that are not present on the remote
|
|
9196
|
+
* @param {boolean} [args.pruneTags = false] - Prune local tags that don’t exist on the remote, and force-update those tags that differ
|
|
9184
9197
|
* @param {string} [args.corsProxy] - Optional [CORS proxy](https://www.npmjs.com/%40isomorphic-git/cors-proxy). Overrides value in repo config.
|
|
9185
9198
|
* @param {Object<string, string>} [args.headers] - Additional headers to include in HTTP requests, similar to git's `extraHeader` config
|
|
9186
9199
|
* @param {object} [args.cache] - a [cache](cache.md) object
|
|
@@ -11336,6 +11349,8 @@ async function packObjects({
|
|
|
11336
11349
|
* @param {string} [args.url] - (Added in 1.1.0) The URL of the remote repository. The default is the value set in the git config for that remote.
|
|
11337
11350
|
* @param {string} [args.remote] - (Added in 1.1.0) If URL is not specified, determines which remote to use.
|
|
11338
11351
|
* @param {string} [args.remoteRef] - (Added in 1.1.0) The name of the branch on the remote to fetch. By default this is the configured remote tracking branch.
|
|
11352
|
+
* @param {boolean} [args.prune = false] - Delete local remote-tracking branches that are not present on the remote
|
|
11353
|
+
* @param {boolean} [args.pruneTags = false] - Prune local tags that don’t exist on the remote, and force-update those tags that differ
|
|
11339
11354
|
* @param {string} [args.corsProxy] - Optional [CORS proxy](https://www.npmjs.com/%40isomorphic-git/cors-proxy). Overrides value in repo config.
|
|
11340
11355
|
* @param {boolean} [args.singleBranch = false] - Instead of the default behavior of fetching all the branches, only fetch a single branch.
|
|
11341
11356
|
* @param {boolean} [args.fastForward = true] - If false, only create merge commits.
|
|
@@ -11381,6 +11396,8 @@ async function pull({
|
|
|
11381
11396
|
url,
|
|
11382
11397
|
remote,
|
|
11383
11398
|
remoteRef,
|
|
11399
|
+
prune = false,
|
|
11400
|
+
pruneTags = false,
|
|
11384
11401
|
fastForward = true,
|
|
11385
11402
|
fastForwardOnly = false,
|
|
11386
11403
|
corsProxy,
|
|
@@ -11431,6 +11448,8 @@ async function pull({
|
|
|
11431
11448
|
author,
|
|
11432
11449
|
committer,
|
|
11433
11450
|
signingKey,
|
|
11451
|
+
prune,
|
|
11452
|
+
pruneTags,
|
|
11434
11453
|
})
|
|
11435
11454
|
} catch (err) {
|
|
11436
11455
|
err.caller = 'git.pull';
|
|
@@ -11794,6 +11813,7 @@ async function _push({
|
|
|
11794
11813
|
}
|
|
11795
11814
|
}
|
|
11796
11815
|
|
|
11816
|
+
if (oid === oldoid) force = true;
|
|
11797
11817
|
if (!force) {
|
|
11798
11818
|
// Is it a tag that already exists?
|
|
11799
11819
|
if (
|
|
@@ -14013,12 +14033,14 @@ function version() {
|
|
|
14013
14033
|
*
|
|
14014
14034
|
* Example 2: Return the difference between the working directory and the HEAD commit
|
|
14015
14035
|
* ```js
|
|
14016
|
-
* const
|
|
14017
|
-
* async function map(filepath, [head, workdir]) {
|
|
14036
|
+
* const map = async (filepath, [head, workdir]) => {
|
|
14018
14037
|
* return {
|
|
14019
14038
|
* filepath,
|
|
14020
|
-
* oid: await head
|
|
14021
|
-
* diff: diff(
|
|
14039
|
+
* oid: await head?.oid(),
|
|
14040
|
+
* diff: diff(
|
|
14041
|
+
* (await head?.content())?.toString('utf8') || '',
|
|
14042
|
+
* (await workdir?.content())?.toString('utf8') || ''
|
|
14043
|
+
* )
|
|
14022
14044
|
* }
|
|
14023
14045
|
* }
|
|
14024
14046
|
* ```
|
package/index.umd.min.d.ts
CHANGED
|
@@ -752,7 +752,7 @@ export function STAGE(): Walker;
|
|
|
752
752
|
* @param {string} [args.ref='HEAD']
|
|
753
753
|
* @returns {Walker}
|
|
754
754
|
*/
|
|
755
|
-
export function TREE({ ref }
|
|
755
|
+
export function TREE({ ref }?: {
|
|
756
756
|
ref?: string;
|
|
757
757
|
}): Walker;
|
|
758
758
|
/**
|
|
@@ -1406,8 +1406,8 @@ export function fastForward({ fs, http, onProgress, onMessage, onAuth, onAuthSuc
|
|
|
1406
1406
|
* @param {boolean} [args.relative = false] - Changes the meaning of `depth` to be measured from the current shallow depth rather than from the branch tip.
|
|
1407
1407
|
* @param {Date} [args.since] - Only fetch commits created after the given date. Mutually exclusive with `depth`.
|
|
1408
1408
|
* @param {string[]} [args.exclude = []] - A list of branches or tags. Instructs the remote server not to send us any commits reachable from these refs.
|
|
1409
|
-
* @param {boolean} [args.prune] - Delete local remote-tracking branches that are not present on the remote
|
|
1410
|
-
* @param {boolean} [args.pruneTags] - Prune local tags that don’t exist on the remote, and force-update those tags that differ
|
|
1409
|
+
* @param {boolean} [args.prune = false] - Delete local remote-tracking branches that are not present on the remote
|
|
1410
|
+
* @param {boolean} [args.pruneTags = false] - Prune local tags that don’t exist on the remote, and force-update those tags that differ
|
|
1411
1411
|
* @param {string} [args.corsProxy] - Optional [CORS proxy](https://www.npmjs.com/%40isomorphic-git/cors-proxy). Overrides value in repo config.
|
|
1412
1412
|
* @param {Object<string, string>} [args.headers] - Additional headers to include in HTTP requests, similar to git's `extraHeader` config
|
|
1413
1413
|
* @param {object} [args.cache] - a [cache](cache.md) object
|
|
@@ -2279,6 +2279,8 @@ export function packObjects({ fs, dir, gitdir, oids, write, cache, }: {
|
|
|
2279
2279
|
* @param {string} [args.url] - (Added in 1.1.0) The URL of the remote repository. The default is the value set in the git config for that remote.
|
|
2280
2280
|
* @param {string} [args.remote] - (Added in 1.1.0) If URL is not specified, determines which remote to use.
|
|
2281
2281
|
* @param {string} [args.remoteRef] - (Added in 1.1.0) The name of the branch on the remote to fetch. By default this is the configured remote tracking branch.
|
|
2282
|
+
* @param {boolean} [args.prune = false] - Delete local remote-tracking branches that are not present on the remote
|
|
2283
|
+
* @param {boolean} [args.pruneTags = false] - Prune local tags that don’t exist on the remote, and force-update those tags that differ
|
|
2282
2284
|
* @param {string} [args.corsProxy] - Optional [CORS proxy](https://www.npmjs.com/%40isomorphic-git/cors-proxy). Overrides value in repo config.
|
|
2283
2285
|
* @param {boolean} [args.singleBranch = false] - Instead of the default behavior of fetching all the branches, only fetch a single branch.
|
|
2284
2286
|
* @param {boolean} [args.fastForward = true] - If false, only create merge commits.
|
|
@@ -2310,7 +2312,7 @@ export function packObjects({ fs, dir, gitdir, oids, write, cache, }: {
|
|
|
2310
2312
|
* console.log('done')
|
|
2311
2313
|
*
|
|
2312
2314
|
*/
|
|
2313
|
-
export function pull({ fs: _fs, http, onProgress, onMessage, onAuth, onAuthSuccess, onAuthFailure, dir, gitdir, ref, url, remote, remoteRef, fastForward, fastForwardOnly, corsProxy, singleBranch, headers, author: _author, committer: _committer, signingKey, cache, }: {
|
|
2315
|
+
export function pull({ fs: _fs, http, onProgress, onMessage, onAuth, onAuthSuccess, onAuthFailure, dir, gitdir, ref, url, remote, remoteRef, prune, pruneTags, fastForward, fastForwardOnly, corsProxy, singleBranch, headers, author: _author, committer: _committer, signingKey, cache, }: {
|
|
2314
2316
|
fs: CallbackFsClient | PromiseFsClient;
|
|
2315
2317
|
http: HttpClient;
|
|
2316
2318
|
onProgress?: ProgressCallback;
|
|
@@ -2324,6 +2326,8 @@ export function pull({ fs: _fs, http, onProgress, onMessage, onAuth, onAuthSucce
|
|
|
2324
2326
|
url?: string;
|
|
2325
2327
|
remote?: string;
|
|
2326
2328
|
remoteRef?: string;
|
|
2329
|
+
prune?: boolean;
|
|
2330
|
+
pruneTags?: boolean;
|
|
2327
2331
|
corsProxy?: string;
|
|
2328
2332
|
singleBranch?: boolean;
|
|
2329
2333
|
fastForward?: boolean;
|
|
@@ -3411,12 +3415,14 @@ export function version(): string;
|
|
|
3411
3415
|
*
|
|
3412
3416
|
* Example 2: Return the difference between the working directory and the HEAD commit
|
|
3413
3417
|
* ```js
|
|
3414
|
-
* const
|
|
3415
|
-
* async function map(filepath, [head, workdir]) {
|
|
3418
|
+
* const map = async (filepath, [head, workdir]) => {
|
|
3416
3419
|
* return {
|
|
3417
3420
|
* filepath,
|
|
3418
|
-
* oid: await head
|
|
3419
|
-
* diff: diff(
|
|
3421
|
+
* oid: await head?.oid(),
|
|
3422
|
+
* diff: diff(
|
|
3423
|
+
* (await head?.content())?.toString('utf8') || '',
|
|
3424
|
+
* (await workdir?.content())?.toString('utf8') || ''
|
|
3425
|
+
* )
|
|
3420
3426
|
* }
|
|
3421
3427
|
* }
|
|
3422
3428
|
* ```
|