isomorphic-git 1.42.0 → 1.42.1

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/index.cjs CHANGED
@@ -9779,8 +9779,8 @@ function filterCapabilities(server, client) {
9779
9779
 
9780
9780
  const pkg = {
9781
9781
  name: 'isomorphic-git',
9782
- version: '1.42.0',
9783
- agent: 'git/isomorphic-git@1.42.0',
9782
+ version: '1.42.1',
9783
+ agent: 'git/isomorphic-git@1.42.1',
9784
9784
  };
9785
9785
 
9786
9786
  class FIFO {
@@ -14476,13 +14476,20 @@ async function _push({
14476
14476
 
14477
14477
  // If remote branch is present, look for a common merge base.
14478
14478
  if (oldoid !== '0000000000000000000000000000000000000000') {
14479
- // trick to speed up common force push scenarios
14480
- const mergebase = await _findMergeBase({
14481
- fs,
14482
- cache,
14483
- gitdir,
14484
- oids: [oid, oldoid],
14485
- });
14479
+ // Speeds up common force-push / thin-pack scenarios. The advertised
14480
+ // remote tip may be absent locally (e.g. remote advanced since clone);
14481
+ // that is normal and must not surface as NotFoundError from merge-base.
14482
+ let mergebase = [];
14483
+ try {
14484
+ mergebase = await _findMergeBase({
14485
+ fs,
14486
+ cache,
14487
+ gitdir,
14488
+ oids: [oid, oldoid],
14489
+ });
14490
+ } catch (e) {
14491
+ mergebase = [];
14492
+ }
14486
14493
  for (const oid of mergebase) finish.push(oid);
14487
14494
  if (thinPack) {
14488
14495
  skipObjects = await listObjects({ fs, cache, gitdir, oids: mergebase });
package/index.js CHANGED
@@ -9766,8 +9766,8 @@ function filterCapabilities(server, client) {
9766
9766
 
9767
9767
  const pkg = {
9768
9768
  name: 'isomorphic-git',
9769
- version: '1.42.0',
9770
- agent: 'git/isomorphic-git@1.42.0',
9769
+ version: '1.42.1',
9770
+ agent: 'git/isomorphic-git@1.42.1',
9771
9771
  };
9772
9772
 
9773
9773
  class FIFO {
@@ -14463,13 +14463,20 @@ async function _push({
14463
14463
 
14464
14464
  // If remote branch is present, look for a common merge base.
14465
14465
  if (oldoid !== '0000000000000000000000000000000000000000') {
14466
- // trick to speed up common force push scenarios
14467
- const mergebase = await _findMergeBase({
14468
- fs,
14469
- cache,
14470
- gitdir,
14471
- oids: [oid, oldoid],
14472
- });
14466
+ // Speeds up common force-push / thin-pack scenarios. The advertised
14467
+ // remote tip may be absent locally (e.g. remote advanced since clone);
14468
+ // that is normal and must not surface as NotFoundError from merge-base.
14469
+ let mergebase = [];
14470
+ try {
14471
+ mergebase = await _findMergeBase({
14472
+ fs,
14473
+ cache,
14474
+ gitdir,
14475
+ oids: [oid, oldoid],
14476
+ });
14477
+ } catch (e) {
14478
+ mergebase = [];
14479
+ }
14473
14480
  for (const oid of mergebase) finish.push(oid);
14474
14481
  if (thinPack) {
14475
14482
  skipObjects = await listObjects({ fs, cache, gitdir, oids: mergebase });