isomorphic-git 1.20.0 → 1.21.0

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.
@@ -1,8 +1,10 @@
1
1
  [
2
2
  "Chrome Headless 79.0.3945.0 (Linux x86_64)",
3
3
  "Firefox 103.0 (Ubuntu 0.0.0)",
4
- "Chrome 103.0.5060.53 (Android 10)",
5
4
  "Edge 79.0.309.65 (Windows 10)",
5
+ "Mobile Safari 13.0 (iOS 13.0)",
6
+ "X Chrome 103.0.5060.53 (Android 10)",
6
7
  "Safari 13.1 (Mac OS 10.15.4)",
7
- "Mobile Safari 13.0 (iOS 13.0)"
8
+ "X Chrome 103.0.5060.53 (Android 10)",
9
+ "Chrome 103.0.5060.53 (Android 10)"
8
10
  ]
package/index.cjs CHANGED
@@ -5393,6 +5393,7 @@ async function annotatedTag({
5393
5393
  * @param {string} args.ref
5394
5394
  * @param {string} [args.object = 'HEAD']
5395
5395
  * @param {boolean} [args.checkout = false]
5396
+ * @param {boolean} [args.force = false]
5396
5397
  *
5397
5398
  * @returns {Promise<void>} Resolves successfully when filesystem operations are complete
5398
5399
  *
@@ -5401,16 +5402,25 @@ async function annotatedTag({
5401
5402
  * console.log('done')
5402
5403
  *
5403
5404
  */
5404
- async function _branch({ fs, gitdir, ref, object, checkout = false }) {
5405
+ async function _branch({
5406
+ fs,
5407
+ gitdir,
5408
+ ref,
5409
+ object,
5410
+ checkout = false,
5411
+ force = false,
5412
+ }) {
5405
5413
  if (ref !== cleanGitRef.clean(ref)) {
5406
5414
  throw new InvalidRefNameError(ref, cleanGitRef.clean(ref))
5407
5415
  }
5408
5416
 
5409
5417
  const fullref = `refs/heads/${ref}`;
5410
5418
 
5411
- const exist = await GitRefManager.exists({ fs, gitdir, ref: fullref });
5412
- if (exist) {
5413
- throw new AlreadyExistsError('branch', ref, false)
5419
+ if (!force) {
5420
+ const exist = await GitRefManager.exists({ fs, gitdir, ref: fullref });
5421
+ if (exist) {
5422
+ throw new AlreadyExistsError('branch', ref, false)
5423
+ }
5414
5424
  }
5415
5425
 
5416
5426
  // Get current HEAD tree oid
@@ -5449,6 +5459,7 @@ async function _branch({ fs, gitdir, ref, object, checkout = false }) {
5449
5459
  * @param {string} args.ref - What to name the branch
5450
5460
  * @param {string} [args.object = 'HEAD'] - What oid to use as the start point. Accepts a symbolic ref.
5451
5461
  * @param {boolean} [args.checkout = false] - Update `HEAD` to point at the newly created branch
5462
+ * @param {boolean} [args.force = false] - Instead of throwing an error if a branched named `ref` already exists, overwrite the existing branch.
5452
5463
  *
5453
5464
  * @returns {Promise<void>} Resolves successfully when filesystem operations are complete
5454
5465
  *
@@ -5464,6 +5475,7 @@ async function branch({
5464
5475
  ref,
5465
5476
  object,
5466
5477
  checkout = false,
5478
+ force = false,
5467
5479
  }) {
5468
5480
  try {
5469
5481
  assertParameter('fs', fs);
@@ -5475,6 +5487,7 @@ async function branch({
5475
5487
  ref,
5476
5488
  object,
5477
5489
  checkout,
5490
+ force,
5478
5491
  })
5479
5492
  } catch (err) {
5480
5493
  err.caller = 'git.branch';
@@ -6994,8 +7007,8 @@ function filterCapabilities(server, client) {
6994
7007
 
6995
7008
  const pkg = {
6996
7009
  name: 'isomorphic-git',
6997
- version: '1.20.0',
6998
- agent: 'git/isomorphic-git@1.20.0',
7010
+ version: '1.21.0',
7011
+ agent: 'git/isomorphic-git@1.21.0',
6999
7012
  };
7000
7013
 
7001
7014
  class FIFO {
package/index.d.ts CHANGED
@@ -934,6 +934,7 @@ export function annotatedTag({ fs: _fs, onSign, dir, gitdir, ref, tagger: _tagge
934
934
  * @param {string} args.ref - What to name the branch
935
935
  * @param {string} [args.object = 'HEAD'] - What oid to use as the start point. Accepts a symbolic ref.
936
936
  * @param {boolean} [args.checkout = false] - Update `HEAD` to point at the newly created branch
937
+ * @param {boolean} [args.force = false] - Instead of throwing an error if a branched named `ref` already exists, overwrite the existing branch.
937
938
  *
938
939
  * @returns {Promise<void>} Resolves successfully when filesystem operations are complete
939
940
  *
@@ -942,13 +943,14 @@ export function annotatedTag({ fs: _fs, onSign, dir, gitdir, ref, tagger: _tagge
942
943
  * console.log('done')
943
944
  *
944
945
  */
945
- export function branch({ fs, dir, gitdir, ref, object, checkout, }: {
946
+ export function branch({ fs, dir, gitdir, ref, object, checkout, force, }: {
946
947
  fs: CallbackFsClient | PromiseFsClient;
947
948
  dir?: string;
948
949
  gitdir?: string;
949
950
  ref: string;
950
951
  object?: string;
951
952
  checkout?: boolean;
953
+ force?: boolean;
952
954
  }): Promise<void>;
953
955
  /**
954
956
  * Checkout a branch
package/index.js CHANGED
@@ -5387,6 +5387,7 @@ async function annotatedTag({
5387
5387
  * @param {string} args.ref
5388
5388
  * @param {string} [args.object = 'HEAD']
5389
5389
  * @param {boolean} [args.checkout = false]
5390
+ * @param {boolean} [args.force = false]
5390
5391
  *
5391
5392
  * @returns {Promise<void>} Resolves successfully when filesystem operations are complete
5392
5393
  *
@@ -5395,16 +5396,25 @@ async function annotatedTag({
5395
5396
  * console.log('done')
5396
5397
  *
5397
5398
  */
5398
- async function _branch({ fs, gitdir, ref, object, checkout = false }) {
5399
+ async function _branch({
5400
+ fs,
5401
+ gitdir,
5402
+ ref,
5403
+ object,
5404
+ checkout = false,
5405
+ force = false,
5406
+ }) {
5399
5407
  if (ref !== cleanGitRef.clean(ref)) {
5400
5408
  throw new InvalidRefNameError(ref, cleanGitRef.clean(ref))
5401
5409
  }
5402
5410
 
5403
5411
  const fullref = `refs/heads/${ref}`;
5404
5412
 
5405
- const exist = await GitRefManager.exists({ fs, gitdir, ref: fullref });
5406
- if (exist) {
5407
- throw new AlreadyExistsError('branch', ref, false)
5413
+ if (!force) {
5414
+ const exist = await GitRefManager.exists({ fs, gitdir, ref: fullref });
5415
+ if (exist) {
5416
+ throw new AlreadyExistsError('branch', ref, false)
5417
+ }
5408
5418
  }
5409
5419
 
5410
5420
  // Get current HEAD tree oid
@@ -5443,6 +5453,7 @@ async function _branch({ fs, gitdir, ref, object, checkout = false }) {
5443
5453
  * @param {string} args.ref - What to name the branch
5444
5454
  * @param {string} [args.object = 'HEAD'] - What oid to use as the start point. Accepts a symbolic ref.
5445
5455
  * @param {boolean} [args.checkout = false] - Update `HEAD` to point at the newly created branch
5456
+ * @param {boolean} [args.force = false] - Instead of throwing an error if a branched named `ref` already exists, overwrite the existing branch.
5446
5457
  *
5447
5458
  * @returns {Promise<void>} Resolves successfully when filesystem operations are complete
5448
5459
  *
@@ -5458,6 +5469,7 @@ async function branch({
5458
5469
  ref,
5459
5470
  object,
5460
5471
  checkout = false,
5472
+ force = false,
5461
5473
  }) {
5462
5474
  try {
5463
5475
  assertParameter('fs', fs);
@@ -5469,6 +5481,7 @@ async function branch({
5469
5481
  ref,
5470
5482
  object,
5471
5483
  checkout,
5484
+ force,
5472
5485
  })
5473
5486
  } catch (err) {
5474
5487
  err.caller = 'git.branch';
@@ -6988,8 +7001,8 @@ function filterCapabilities(server, client) {
6988
7001
 
6989
7002
  const pkg = {
6990
7003
  name: 'isomorphic-git',
6991
- version: '1.20.0',
6992
- agent: 'git/isomorphic-git@1.20.0',
7004
+ version: '1.21.0',
7005
+ agent: 'git/isomorphic-git@1.21.0',
6993
7006
  };
6994
7007
 
6995
7008
  class FIFO {
@@ -934,6 +934,7 @@ export function annotatedTag({ fs: _fs, onSign, dir, gitdir, ref, tagger: _tagge
934
934
  * @param {string} args.ref - What to name the branch
935
935
  * @param {string} [args.object = 'HEAD'] - What oid to use as the start point. Accepts a symbolic ref.
936
936
  * @param {boolean} [args.checkout = false] - Update `HEAD` to point at the newly created branch
937
+ * @param {boolean} [args.force = false] - Instead of throwing an error if a branched named `ref` already exists, overwrite the existing branch.
937
938
  *
938
939
  * @returns {Promise<void>} Resolves successfully when filesystem operations are complete
939
940
  *
@@ -942,13 +943,14 @@ export function annotatedTag({ fs: _fs, onSign, dir, gitdir, ref, tagger: _tagge
942
943
  * console.log('done')
943
944
  *
944
945
  */
945
- export function branch({ fs, dir, gitdir, ref, object, checkout, }: {
946
+ export function branch({ fs, dir, gitdir, ref, object, checkout, force, }: {
946
947
  fs: CallbackFsClient | PromiseFsClient;
947
948
  dir?: string;
948
949
  gitdir?: string;
949
950
  ref: string;
950
951
  object?: string;
951
952
  checkout?: boolean;
953
+ force?: boolean;
952
954
  }): Promise<void>;
953
955
  /**
954
956
  * Checkout a branch