isomorphic-git 1.40.4 → 1.40.6

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
@@ -8320,7 +8320,7 @@ async function checkAndWriteBlob(fs, gitdir, dir, filepath, oid = null) {
8320
8320
  : undefined;
8321
8321
  let retOid = objContent ? oid : undefined;
8322
8322
  if (!objContent) {
8323
- await acquireLock$1({ fs, gitdir, currentFilepath }, async () => {
8323
+ await acquireLock$1(currentFilepath, async () => {
8324
8324
  const object = stats.isSymbolicLink()
8325
8325
  ? await fs.readlink(currentFilepath).then(posixifyPathBuffer)
8326
8326
  : await fs.read(currentFilepath);
@@ -8535,7 +8535,7 @@ async function applyTreeChanges({
8535
8535
  });
8536
8536
 
8537
8537
  // apply the changes to work dir
8538
- await acquireLock$1({ fs, gitdir, dirRemoved, ops }, async () => {
8538
+ await acquireLock$1(gitdir, async () => {
8539
8539
  for (const op of ops) {
8540
8540
  const currentFilepath = join(dir, op.filepath);
8541
8541
  switch (op.method) {
@@ -9572,8 +9572,8 @@ function filterCapabilities(server, client) {
9572
9572
 
9573
9573
  const pkg = {
9574
9574
  name: 'isomorphic-git',
9575
- version: '1.40.4',
9576
- agent: 'git/isomorphic-git@1.40.4',
9575
+ version: '1.40.6',
9576
+ agent: 'git/isomorphic-git@1.40.6',
9577
9577
  };
9578
9578
 
9579
9579
  class FIFO {
@@ -11961,11 +11961,13 @@ function formatInfoRefs(remote, prefix, symrefs, peelTags) {
11961
11961
  const _key = key.replace('^{}', '');
11962
11962
  // Peeled tags are almost always listed immediately after the original tag
11963
11963
  const last = refs[refs.length - 1];
11964
- const r = last.ref === _key ? last : refs.find(x => x.ref === _key);
11965
- if (r === undefined) {
11966
- throw new Error('I did not expect this to happen')
11964
+ const r = last?.ref === _key ? last : refs.find(x => x.ref === _key);
11965
+ // The tag itself can be absent when `prefix` filtered it out: the
11966
+ // peeled name is longer, so it can match a prefix the tag does not.
11967
+ // There is nothing to attach the peeled oid to, so drop it.
11968
+ if (r !== undefined) {
11969
+ r.peeled = value;
11967
11970
  }
11968
- r.peeled = value;
11969
11971
  }
11970
11972
  continue
11971
11973
  }
@@ -15928,7 +15930,7 @@ class GitStashManager {
15928
15930
  );
15929
15931
  const filepath = this.refLogsStashPath;
15930
15932
 
15931
- await acquireLock$1({ filepath, entry }, async () => {
15933
+ await acquireLock$1(filepath, async () => {
15932
15934
  const appendTo = (await this.fs.exists(filepath))
15933
15935
  ? await this.fs.read(filepath, 'utf8')
15934
15936
  : '';
@@ -16138,7 +16140,7 @@ async function _stashDrop({ fs, dir, gitdir, refIdx = 0 }) {
16138
16140
  reflogEntries.splice(refIdx, 1);
16139
16141
 
16140
16142
  const stashReflogPath = stashMgr.refLogsStashPath;
16141
- await acquireLock$1({ reflogEntries, stashReflogPath, stashMgr }, async () => {
16143
+ await acquireLock$1(stashReflogPath, async () => {
16142
16144
  if (reflogEntries.length) {
16143
16145
  await fs.write(
16144
16146
  stashReflogPath,
package/index.js CHANGED
@@ -8307,7 +8307,7 @@ async function checkAndWriteBlob(fs, gitdir, dir, filepath, oid = null) {
8307
8307
  : undefined;
8308
8308
  let retOid = objContent ? oid : undefined;
8309
8309
  if (!objContent) {
8310
- await acquireLock$1({ fs, gitdir, currentFilepath }, async () => {
8310
+ await acquireLock$1(currentFilepath, async () => {
8311
8311
  const object = stats.isSymbolicLink()
8312
8312
  ? await fs.readlink(currentFilepath).then(posixifyPathBuffer)
8313
8313
  : await fs.read(currentFilepath);
@@ -8522,7 +8522,7 @@ async function applyTreeChanges({
8522
8522
  });
8523
8523
 
8524
8524
  // apply the changes to work dir
8525
- await acquireLock$1({ fs, gitdir, dirRemoved, ops }, async () => {
8525
+ await acquireLock$1(gitdir, async () => {
8526
8526
  for (const op of ops) {
8527
8527
  const currentFilepath = join(dir, op.filepath);
8528
8528
  switch (op.method) {
@@ -9559,8 +9559,8 @@ function filterCapabilities(server, client) {
9559
9559
 
9560
9560
  const pkg = {
9561
9561
  name: 'isomorphic-git',
9562
- version: '1.40.4',
9563
- agent: 'git/isomorphic-git@1.40.4',
9562
+ version: '1.40.6',
9563
+ agent: 'git/isomorphic-git@1.40.6',
9564
9564
  };
9565
9565
 
9566
9566
  class FIFO {
@@ -11948,11 +11948,13 @@ function formatInfoRefs(remote, prefix, symrefs, peelTags) {
11948
11948
  const _key = key.replace('^{}', '');
11949
11949
  // Peeled tags are almost always listed immediately after the original tag
11950
11950
  const last = refs[refs.length - 1];
11951
- const r = last.ref === _key ? last : refs.find(x => x.ref === _key);
11952
- if (r === undefined) {
11953
- throw new Error('I did not expect this to happen')
11951
+ const r = last?.ref === _key ? last : refs.find(x => x.ref === _key);
11952
+ // The tag itself can be absent when `prefix` filtered it out: the
11953
+ // peeled name is longer, so it can match a prefix the tag does not.
11954
+ // There is nothing to attach the peeled oid to, so drop it.
11955
+ if (r !== undefined) {
11956
+ r.peeled = value;
11954
11957
  }
11955
- r.peeled = value;
11956
11958
  }
11957
11959
  continue
11958
11960
  }
@@ -15915,7 +15917,7 @@ class GitStashManager {
15915
15917
  );
15916
15918
  const filepath = this.refLogsStashPath;
15917
15919
 
15918
- await acquireLock$1({ filepath, entry }, async () => {
15920
+ await acquireLock$1(filepath, async () => {
15919
15921
  const appendTo = (await this.fs.exists(filepath))
15920
15922
  ? await this.fs.read(filepath, 'utf8')
15921
15923
  : '';
@@ -16125,7 +16127,7 @@ async function _stashDrop({ fs, dir, gitdir, refIdx = 0 }) {
16125
16127
  reflogEntries.splice(refIdx, 1);
16126
16128
 
16127
16129
  const stashReflogPath = stashMgr.refLogsStashPath;
16128
- await acquireLock$1({ reflogEntries, stashReflogPath, stashMgr }, async () => {
16130
+ await acquireLock$1(stashReflogPath, async () => {
16129
16131
  if (reflogEntries.length) {
16130
16132
  await fs.write(
16131
16133
  stashReflogPath,