isomorphic-git 1.30.1 โ†’ 1.30.3

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 CHANGED
@@ -111,7 +111,8 @@ Then check out the [Useful Snippets](https://isomorphic-git.org/docs/en/snippets
111
111
 
112
112
  Unfortunately, due to the same-origin policy by default `isomorphic-git` can only clone from the same origin as the webpage it is running on. This is terribly inconvenient, as it means for all practical purposes cloning and pushing repos must be done through a proxy.
113
113
 
114
- For this purpose [@isomorphic-git/cors-proxy](https://github.com/isomorphic-git/cors-proxy) exists which you can clone or [`npm install`](https://www.npmjs.com/package/@isomorphic-git/cors-proxy).
114
+ For this purpose, [@isomorphic-git/cors-proxy](https://github.com/isomorphic-git/cors-proxy) exists; which you can clone it or [`npm install`](https://www.npmjs.com/package/@isomorphic-git/cors-proxy) it. Alternatively, use CloudFlare workers, which can be setup without leaving the browser ([instructions](https://gist.github.com/tomlarkworthy/cf1d4ceabeabdb6d1628575ab3a83acf)).
115
+
115
116
  For testing or small projects, you can also use [https://cors.isomorphic-git.org](https://cors.isomorphic-git.org) - a free proxy sponsored by [Clever Cloud](https://www.clever-cloud.com/?utm_source=ref&utm_medium=link&utm_campaign=isomorphic-git).
116
117
 
117
118
  We hope to get CORS headers added to all the major Git hosting platforms eventually, and will list the progress made here:
@@ -357,7 +358,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
357
358
  <td align="center"><a href="https://www.platformdemos.com/"><img src="https://avatars.githubusercontent.com/u/4261788?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Shane McLaughlin</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=mshanemc" title="Code">๐Ÿ’ป</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=mshanemc" title="Documentation">๐Ÿ“–</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=mshanemc" title="Tests">โš ๏ธ</a></td>
358
359
  </tr>
359
360
  <tr>
360
- <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>
361
+ <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> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=seanpoulter" title="Code">๐Ÿ’ป</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=seanpoulter" title="Documentation">๐Ÿ“–</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=seanpoulter" title="Tests">โš ๏ธ</a></td>
361
362
  <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>
362
363
  <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>
363
364
  <td align="center"><a href="https://gitlab.com/CoalZombik/"><img src="https://avatars.githubusercontent.com/u/49895741?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Lukรกลก Cezner</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=CoalZombik" title="Code">๐Ÿ’ป</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=CoalZombik" title="Documentation">๐Ÿ“–</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=CoalZombik" title="Tests">โš ๏ธ</a> <a href="https://github.com/isomorphic-git/isomorphic-git/issues?q=author%3ACoalZombik" title="Bug reports">๐Ÿ›</a></td>
@@ -385,6 +386,8 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
385
386
  </tr>
386
387
  <tr>
387
388
  <td align="center"><a href="https://github.com/lukecotter"><img src="https://avatars.githubusercontent.com/u/4013877?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Luke Cotter</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=lukecotter" title="Code">๐Ÿ’ป</a></td>
389
+ <td align="center"><a href="https://tomlarkworthy.endpointservices.net/"><img src="https://avatars.githubusercontent.com/u/1848162?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Tom Larkworthy</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=tomlarkworthy" title="Documentation">๐Ÿ“–</a></td>
390
+ <td align="center"><a href="https://github.com/kofta999"><img src="https://avatars.githubusercontent.com/u/99273340?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Mostafa Mahmoud</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=kofta999" title="Code">๐Ÿ’ป</a> <a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=kofta999" title="Tests">โš ๏ธ</a> <a href="#question-kofta999" title="Answering Questions">๐Ÿ’ฌ</a></td>
388
391
  </tr>
389
392
  </table>
390
393
 
@@ -1,10 +1,8 @@
1
1
  [
2
2
  "Chrome Headless 79.0.3945.0 (Linux x86_64)",
3
- "Firefox 136.0 (Ubuntu 0.0.0)",
4
- "X Chrome 128.0.0.0 (Android 10)",
3
+ "Firefox 139.0 (Linux x86_64)",
5
4
  "Edge 79.0.309.65 (Windows 10)",
5
+ "Chrome 135.0.0.0 (Android 10)",
6
6
  "Mobile Safari 14.0 (iOS 14.0.1)",
7
- "Safari 14.1 (Mac OS 10.15.7)",
8
- "Chrome Headless 79.0.3945.0 (Linux x86_64)",
9
- "Chrome 128.0.0.0 (Android 10)"
7
+ "Safari 14.1 (Mac OS 10.15.7)"
10
8
  ]
package/index.cjs CHANGED
@@ -7644,8 +7644,8 @@ function filterCapabilities(server, client) {
7644
7644
 
7645
7645
  const pkg = {
7646
7646
  name: 'isomorphic-git',
7647
- version: '1.30.1',
7648
- agent: 'git/isomorphic-git@1.30.1',
7647
+ version: '1.30.3',
7648
+ agent: 'git/isomorphic-git@1.30.3',
7649
7649
  };
7650
7650
 
7651
7651
  class FIFO {
@@ -9253,6 +9253,16 @@ async function mergeTree({
9253
9253
  }
9254
9254
  }
9255
9255
  case 'false-true': {
9256
+ // if directory is deleted in theirs but not in ours we return our directory
9257
+ if (!theirs && (await ours.type()) === 'tree') {
9258
+ return {
9259
+ mode: await ours.mode(),
9260
+ path,
9261
+ oid: await ours.oid(),
9262
+ type: await ours.type(),
9263
+ }
9264
+ }
9265
+
9256
9266
  return theirs
9257
9267
  ? {
9258
9268
  mode: await theirs.mode(),
@@ -9263,6 +9273,16 @@ async function mergeTree({
9263
9273
  : undefined
9264
9274
  }
9265
9275
  case 'true-false': {
9276
+ // if directory is deleted in ours but not in theirs we return their directory
9277
+ if (!ours && (await theirs.type()) === 'tree') {
9278
+ return {
9279
+ mode: await theirs.mode(),
9280
+ path,
9281
+ oid: await theirs.oid(),
9282
+ type: await theirs.type(),
9283
+ }
9284
+ }
9285
+
9266
9286
  return ours
9267
9287
  ? {
9268
9288
  mode: await ours.mode(),
@@ -9372,7 +9392,12 @@ async function mergeTree({
9372
9392
  }
9373
9393
 
9374
9394
  // deleted by both
9375
- if (base && !ours && !theirs && (await base.type()) === 'blob') {
9395
+ if (
9396
+ base &&
9397
+ !ours &&
9398
+ !theirs &&
9399
+ ((await base.type()) === 'blob' || (await base.type()) === 'tree')
9400
+ ) {
9376
9401
  return undefined
9377
9402
  }
9378
9403
 
@@ -9396,9 +9421,19 @@ async function mergeTree({
9396
9421
  if (!parent) return
9397
9422
 
9398
9423
  // automatically delete directories if they have been emptied
9399
- if (parent && parent.type === 'tree' && entries.length === 0) return
9424
+ // except for the root directory
9425
+ if (
9426
+ parent &&
9427
+ parent.type === 'tree' &&
9428
+ entries.length === 0 &&
9429
+ parent.path !== '.'
9430
+ )
9431
+ return
9400
9432
 
9401
- if (entries.length > 0) {
9433
+ if (
9434
+ entries.length > 0 ||
9435
+ (parent.path === '.' && entries.length === 0)
9436
+ ) {
9402
9437
  const tree = new GitTree(entries);
9403
9438
  const object = tree.toObject();
9404
9439
  const oid = await _writeObject({
@@ -9662,7 +9697,7 @@ async function _merge({
9662
9697
  );
9663
9698
 
9664
9699
  // Defer throwing error until the index lock is relinquished and index is
9665
- // written to filsesystem
9700
+ // written to filesystem
9666
9701
  if (tree instanceof MergeConflictError) throw tree
9667
9702
 
9668
9703
  if (!message) {
package/index.js CHANGED
@@ -7638,8 +7638,8 @@ function filterCapabilities(server, client) {
7638
7638
 
7639
7639
  const pkg = {
7640
7640
  name: 'isomorphic-git',
7641
- version: '1.30.1',
7642
- agent: 'git/isomorphic-git@1.30.1',
7641
+ version: '1.30.3',
7642
+ agent: 'git/isomorphic-git@1.30.3',
7643
7643
  };
7644
7644
 
7645
7645
  class FIFO {
@@ -9247,6 +9247,16 @@ async function mergeTree({
9247
9247
  }
9248
9248
  }
9249
9249
  case 'false-true': {
9250
+ // if directory is deleted in theirs but not in ours we return our directory
9251
+ if (!theirs && (await ours.type()) === 'tree') {
9252
+ return {
9253
+ mode: await ours.mode(),
9254
+ path,
9255
+ oid: await ours.oid(),
9256
+ type: await ours.type(),
9257
+ }
9258
+ }
9259
+
9250
9260
  return theirs
9251
9261
  ? {
9252
9262
  mode: await theirs.mode(),
@@ -9257,6 +9267,16 @@ async function mergeTree({
9257
9267
  : undefined
9258
9268
  }
9259
9269
  case 'true-false': {
9270
+ // if directory is deleted in ours but not in theirs we return their directory
9271
+ if (!ours && (await theirs.type()) === 'tree') {
9272
+ return {
9273
+ mode: await theirs.mode(),
9274
+ path,
9275
+ oid: await theirs.oid(),
9276
+ type: await theirs.type(),
9277
+ }
9278
+ }
9279
+
9260
9280
  return ours
9261
9281
  ? {
9262
9282
  mode: await ours.mode(),
@@ -9366,7 +9386,12 @@ async function mergeTree({
9366
9386
  }
9367
9387
 
9368
9388
  // deleted by both
9369
- if (base && !ours && !theirs && (await base.type()) === 'blob') {
9389
+ if (
9390
+ base &&
9391
+ !ours &&
9392
+ !theirs &&
9393
+ ((await base.type()) === 'blob' || (await base.type()) === 'tree')
9394
+ ) {
9370
9395
  return undefined
9371
9396
  }
9372
9397
 
@@ -9390,9 +9415,19 @@ async function mergeTree({
9390
9415
  if (!parent) return
9391
9416
 
9392
9417
  // automatically delete directories if they have been emptied
9393
- if (parent && parent.type === 'tree' && entries.length === 0) return
9418
+ // except for the root directory
9419
+ if (
9420
+ parent &&
9421
+ parent.type === 'tree' &&
9422
+ entries.length === 0 &&
9423
+ parent.path !== '.'
9424
+ )
9425
+ return
9394
9426
 
9395
- if (entries.length > 0) {
9427
+ if (
9428
+ entries.length > 0 ||
9429
+ (parent.path === '.' && entries.length === 0)
9430
+ ) {
9396
9431
  const tree = new GitTree(entries);
9397
9432
  const object = tree.toObject();
9398
9433
  const oid = await _writeObject({
@@ -9656,7 +9691,7 @@ async function _merge({
9656
9691
  );
9657
9692
 
9658
9693
  // Defer throwing error until the index lock is relinquished and index is
9659
- // written to filsesystem
9694
+ // written to filesystem
9660
9695
  if (tree instanceof MergeConflictError) throw tree
9661
9696
 
9662
9697
  if (!message) {