isomorphic-git 1.41.4 → 1.41.5

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
@@ -6321,6 +6321,23 @@ async function constructTree({ fs, gitdir, inode, dryRun }) {
6321
6321
  // @ts-check
6322
6322
 
6323
6323
  async function resolveFilepath({ fs, cache, gitdir, oid, filepath }) {
6324
+ const entry = await resolveFilepathEntry({
6325
+ fs,
6326
+ cache,
6327
+ gitdir,
6328
+ oid,
6329
+ filepath,
6330
+ });
6331
+ return entry.oid
6332
+ }
6333
+
6334
+ async function resolveFilepathEntry({
6335
+ fs,
6336
+ cache,
6337
+ gitdir,
6338
+ oid,
6339
+ filepath,
6340
+ }) {
6324
6341
  // Ensure there are no leading or trailing directory separators.
6325
6342
  // I was going to do this automatically, but then found that the Git Terminal for Windows
6326
6343
  // auto-expands --filepath=/src/utils to --filepath=C:/Users/Will/AppData/Local/Programs/Git/src/utils
@@ -6334,10 +6351,10 @@ async function resolveFilepath({ fs, cache, gitdir, oid, filepath }) {
6334
6351
  const result = await resolveTree({ fs, cache, gitdir, oid });
6335
6352
  const tree = result.tree;
6336
6353
  if (filepath === '') {
6337
- oid = result.oid;
6354
+ return { mode: '040000', oid: result.oid, path: '', type: 'tree' }
6338
6355
  } else {
6339
6356
  const pathArray = filepath.split('/');
6340
- oid = await _resolveFilepath({
6357
+ return _resolveFilepath({
6341
6358
  fs,
6342
6359
  cache,
6343
6360
  gitdir,
@@ -6345,9 +6362,8 @@ async function resolveFilepath({ fs, cache, gitdir, oid, filepath }) {
6345
6362
  pathArray,
6346
6363
  oid: _oid,
6347
6364
  filepath,
6348
- });
6365
+ })
6349
6366
  }
6350
- return oid
6351
6367
  }
6352
6368
 
6353
6369
  async function _resolveFilepath({
@@ -6363,7 +6379,7 @@ async function _resolveFilepath({
6363
6379
  for (const entry of tree) {
6364
6380
  if (entry.path === name) {
6365
6381
  if (pathArray.length === 0) {
6366
- return entry.oid
6382
+ return entry
6367
6383
  } else {
6368
6384
  const { type, object } = await _readObject({
6369
6385
  fs,
@@ -9712,8 +9728,8 @@ function filterCapabilities(server, client) {
9712
9728
 
9713
9729
  const pkg = {
9714
9730
  name: 'isomorphic-git',
9715
- version: '1.41.4',
9716
- agent: 'git/isomorphic-git@1.41.4',
9731
+ version: '1.41.5',
9732
+ agent: 'git/isomorphic-git@1.41.5',
9717
9733
  };
9718
9734
 
9719
9735
  class FIFO {
@@ -13327,6 +13343,7 @@ async function _log({
13327
13343
  const oid = await GitRefManager.resolve({ fs, gitdir, ref });
13328
13344
  const tips = [await _readCommit({ fs, cache, gitdir, oid })];
13329
13345
  let lastFileOid;
13346
+ let lastFileMode;
13330
13347
  let lastCommit;
13331
13348
  let isOk;
13332
13349
 
@@ -13346,19 +13363,23 @@ async function _log({
13346
13363
  }
13347
13364
 
13348
13365
  if (filepath) {
13349
- let vFileOid;
13366
+ let vFileEntry;
13350
13367
  try {
13351
- vFileOid = await resolveFilepath({
13368
+ vFileEntry = await resolveFilepathEntry({
13352
13369
  fs,
13353
13370
  cache,
13354
13371
  gitdir,
13355
13372
  oid: commit.commit.tree,
13356
13373
  filepath,
13357
13374
  });
13358
- if (lastCommit && lastFileOid !== vFileOid) {
13375
+ if (
13376
+ lastCommit &&
13377
+ (lastFileOid !== vFileEntry.oid || lastFileMode !== vFileEntry.mode)
13378
+ ) {
13359
13379
  commits.push(lastCommit);
13360
13380
  }
13361
- lastFileOid = vFileOid;
13381
+ lastFileOid = vFileEntry.oid;
13382
+ lastFileMode = vFileEntry.mode;
13362
13383
  lastCommit = commit;
13363
13384
  isOk = true;
13364
13385
  } catch (e) {
package/index.js CHANGED
@@ -6308,6 +6308,23 @@ async function constructTree({ fs, gitdir, inode, dryRun }) {
6308
6308
  // @ts-check
6309
6309
 
6310
6310
  async function resolveFilepath({ fs, cache, gitdir, oid, filepath }) {
6311
+ const entry = await resolveFilepathEntry({
6312
+ fs,
6313
+ cache,
6314
+ gitdir,
6315
+ oid,
6316
+ filepath,
6317
+ });
6318
+ return entry.oid
6319
+ }
6320
+
6321
+ async function resolveFilepathEntry({
6322
+ fs,
6323
+ cache,
6324
+ gitdir,
6325
+ oid,
6326
+ filepath,
6327
+ }) {
6311
6328
  // Ensure there are no leading or trailing directory separators.
6312
6329
  // I was going to do this automatically, but then found that the Git Terminal for Windows
6313
6330
  // auto-expands --filepath=/src/utils to --filepath=C:/Users/Will/AppData/Local/Programs/Git/src/utils
@@ -6321,10 +6338,10 @@ async function resolveFilepath({ fs, cache, gitdir, oid, filepath }) {
6321
6338
  const result = await resolveTree({ fs, cache, gitdir, oid });
6322
6339
  const tree = result.tree;
6323
6340
  if (filepath === '') {
6324
- oid = result.oid;
6341
+ return { mode: '040000', oid: result.oid, path: '', type: 'tree' }
6325
6342
  } else {
6326
6343
  const pathArray = filepath.split('/');
6327
- oid = await _resolveFilepath({
6344
+ return _resolveFilepath({
6328
6345
  fs,
6329
6346
  cache,
6330
6347
  gitdir,
@@ -6332,9 +6349,8 @@ async function resolveFilepath({ fs, cache, gitdir, oid, filepath }) {
6332
6349
  pathArray,
6333
6350
  oid: _oid,
6334
6351
  filepath,
6335
- });
6352
+ })
6336
6353
  }
6337
- return oid
6338
6354
  }
6339
6355
 
6340
6356
  async function _resolveFilepath({
@@ -6350,7 +6366,7 @@ async function _resolveFilepath({
6350
6366
  for (const entry of tree) {
6351
6367
  if (entry.path === name) {
6352
6368
  if (pathArray.length === 0) {
6353
- return entry.oid
6369
+ return entry
6354
6370
  } else {
6355
6371
  const { type, object } = await _readObject({
6356
6372
  fs,
@@ -9699,8 +9715,8 @@ function filterCapabilities(server, client) {
9699
9715
 
9700
9716
  const pkg = {
9701
9717
  name: 'isomorphic-git',
9702
- version: '1.41.4',
9703
- agent: 'git/isomorphic-git@1.41.4',
9718
+ version: '1.41.5',
9719
+ agent: 'git/isomorphic-git@1.41.5',
9704
9720
  };
9705
9721
 
9706
9722
  class FIFO {
@@ -13314,6 +13330,7 @@ async function _log({
13314
13330
  const oid = await GitRefManager.resolve({ fs, gitdir, ref });
13315
13331
  const tips = [await _readCommit({ fs, cache, gitdir, oid })];
13316
13332
  let lastFileOid;
13333
+ let lastFileMode;
13317
13334
  let lastCommit;
13318
13335
  let isOk;
13319
13336
 
@@ -13333,19 +13350,23 @@ async function _log({
13333
13350
  }
13334
13351
 
13335
13352
  if (filepath) {
13336
- let vFileOid;
13353
+ let vFileEntry;
13337
13354
  try {
13338
- vFileOid = await resolveFilepath({
13355
+ vFileEntry = await resolveFilepathEntry({
13339
13356
  fs,
13340
13357
  cache,
13341
13358
  gitdir,
13342
13359
  oid: commit.commit.tree,
13343
13360
  filepath,
13344
13361
  });
13345
- if (lastCommit && lastFileOid !== vFileOid) {
13362
+ if (
13363
+ lastCommit &&
13364
+ (lastFileOid !== vFileEntry.oid || lastFileMode !== vFileEntry.mode)
13365
+ ) {
13346
13366
  commits.push(lastCommit);
13347
13367
  }
13348
- lastFileOid = vFileOid;
13368
+ lastFileOid = vFileEntry.oid;
13369
+ lastFileMode = vFileEntry.mode;
13349
13370
  lastCommit = commit;
13350
13371
  isOk = true;
13351
13372
  } catch (e) {