isomorphic-git 1.30.0 โ 1.30.2
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 +2 -1
- package/browser-tests.json +4 -4
- package/index.cjs +62 -31
- package/index.js +62 -31
- package/index.umd.min.js +1 -1
- package/index.umd.min.js.map +1 -1
- package/package.json +2 -3
- package/size_report.html +1 -1
package/README.md
CHANGED
|
@@ -357,7 +357,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
|
|
|
357
357
|
<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
358
|
</tr>
|
|
359
359
|
<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>
|
|
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> <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
361
|
<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
362
|
<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
363
|
<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 +385,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
|
|
|
385
385
|
</tr>
|
|
386
386
|
<tr>
|
|
387
387
|
<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>
|
|
388
|
+
<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
389
|
</tr>
|
|
389
390
|
</table>
|
|
390
391
|
|
package/browser-tests.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
"Chrome Headless 79.0.3945.0 (Linux x86_64)",
|
|
3
|
-
"Firefox
|
|
4
|
-
"Chrome
|
|
3
|
+
"Firefox 138.0 (Ubuntu 0.0.0)",
|
|
4
|
+
"Chrome 135.0.0.0 (Android 10)",
|
|
5
5
|
"Edge 79.0.309.65 (Windows 10)",
|
|
6
|
-
"Safari 14.
|
|
7
|
-
"
|
|
6
|
+
"Mobile Safari 14.0 (iOS 14.0.1)",
|
|
7
|
+
"Safari 14.1 (Mac OS 10.15.7)"
|
|
8
8
|
]
|
package/index.cjs
CHANGED
|
@@ -979,8 +979,11 @@ function createCache() {
|
|
|
979
979
|
}
|
|
980
980
|
|
|
981
981
|
async function updateCachedIndexFile(fs, filepath, cache) {
|
|
982
|
-
const stat = await
|
|
983
|
-
|
|
982
|
+
const [stat, rawIndexFile] = await Promise.all([
|
|
983
|
+
fs.lstat(filepath),
|
|
984
|
+
fs.read(filepath),
|
|
985
|
+
]);
|
|
986
|
+
|
|
984
987
|
const index = await GitIndex.from(rawIndexFile);
|
|
985
988
|
// cache the GitIndex object so we don't need to re-read it every time.
|
|
986
989
|
cache.map.set(filepath, index);
|
|
@@ -992,8 +995,9 @@ async function updateCachedIndexFile(fs, filepath, cache) {
|
|
|
992
995
|
async function isIndexStale(fs, filepath, cache) {
|
|
993
996
|
const savedStats = cache.stats.get(filepath);
|
|
994
997
|
if (savedStats === undefined) return true
|
|
995
|
-
const currStats = await fs.lstat(filepath);
|
|
996
998
|
if (savedStats === null) return false
|
|
999
|
+
|
|
1000
|
+
const currStats = await fs.lstat(filepath);
|
|
997
1001
|
if (currStats === null) return false
|
|
998
1002
|
return compareStats(savedStats, currStats)
|
|
999
1003
|
}
|
|
@@ -1009,7 +1013,9 @@ class GitIndexManager {
|
|
|
1009
1013
|
* @param {function(GitIndex): any} closure
|
|
1010
1014
|
*/
|
|
1011
1015
|
static async acquire({ fs, gitdir, cache, allowUnmerged = true }, closure) {
|
|
1012
|
-
if (!cache[IndexCache])
|
|
1016
|
+
if (!cache[IndexCache]) {
|
|
1017
|
+
cache[IndexCache] = createCache();
|
|
1018
|
+
}
|
|
1013
1019
|
|
|
1014
1020
|
const filepath = `${gitdir}/index`;
|
|
1015
1021
|
if (lock === null) lock = new AsyncLock({ maxPending: Infinity });
|
|
@@ -1020,10 +1026,11 @@ class GitIndexManager {
|
|
|
1020
1026
|
// to make sure other processes aren't writing to it
|
|
1021
1027
|
// simultaneously, which could result in a corrupted index.
|
|
1022
1028
|
// const fileLock = await Lock(filepath)
|
|
1023
|
-
|
|
1024
|
-
|
|
1029
|
+
const theIndexCache = cache[IndexCache];
|
|
1030
|
+
if (await isIndexStale(fs, filepath, theIndexCache)) {
|
|
1031
|
+
await updateCachedIndexFile(fs, filepath, theIndexCache);
|
|
1025
1032
|
}
|
|
1026
|
-
const index =
|
|
1033
|
+
const index = theIndexCache.map.get(filepath);
|
|
1027
1034
|
unmergedPaths = index.unmergedPaths;
|
|
1028
1035
|
|
|
1029
1036
|
if (unmergedPaths.length && !allowUnmerged)
|
|
@@ -1036,7 +1043,7 @@ class GitIndexManager {
|
|
|
1036
1043
|
const buffer = await index.toObject();
|
|
1037
1044
|
await fs.write(filepath, buffer);
|
|
1038
1045
|
// Update cached stat value
|
|
1039
|
-
|
|
1046
|
+
theIndexCache.stats.set(filepath, await fs.lstat(filepath));
|
|
1040
1047
|
index._dirty = false;
|
|
1041
1048
|
}
|
|
1042
1049
|
});
|
|
@@ -4261,7 +4268,7 @@ class GitWalkerFs {
|
|
|
4261
4268
|
oid = undefined;
|
|
4262
4269
|
} else {
|
|
4263
4270
|
oid = await shasum(
|
|
4264
|
-
GitObject.wrap({ type: 'blob', object:
|
|
4271
|
+
GitObject.wrap({ type: 'blob', object: content })
|
|
4265
4272
|
);
|
|
4266
4273
|
// Update the stats in the index so we will get a "cache hit" next time
|
|
4267
4274
|
// 1) if we can (because the oid and mode are the same)
|
|
@@ -4452,15 +4459,20 @@ async function _walk({
|
|
|
4452
4459
|
const range = arrayRange(0, walkers.length);
|
|
4453
4460
|
const unionWalkerFromReaddir = async entries => {
|
|
4454
4461
|
range.map(i => {
|
|
4455
|
-
|
|
4462
|
+
const entry = entries[i];
|
|
4463
|
+
entries[i] = entry && new walkers[i].ConstructEntry(entry);
|
|
4456
4464
|
});
|
|
4457
4465
|
const subdirs = await Promise.all(
|
|
4458
|
-
range.map(i =>
|
|
4466
|
+
range.map(i => {
|
|
4467
|
+
const entry = entries[i];
|
|
4468
|
+
return entry ? walkers[i].readdir(entry) : []
|
|
4469
|
+
})
|
|
4459
4470
|
);
|
|
4460
4471
|
// Now process child directories
|
|
4461
|
-
const iterators = subdirs
|
|
4462
|
-
|
|
4463
|
-
|
|
4472
|
+
const iterators = subdirs.map(array => {
|
|
4473
|
+
return (array === null ? [] : array)[Symbol.iterator]()
|
|
4474
|
+
});
|
|
4475
|
+
|
|
4464
4476
|
return {
|
|
4465
4477
|
entries,
|
|
4466
4478
|
children: unionOfIterators(iterators),
|
|
@@ -7632,8 +7644,8 @@ function filterCapabilities(server, client) {
|
|
|
7632
7644
|
|
|
7633
7645
|
const pkg = {
|
|
7634
7646
|
name: 'isomorphic-git',
|
|
7635
|
-
version: '1.30.
|
|
7636
|
-
agent: 'git/isomorphic-git@1.30.
|
|
7647
|
+
version: '1.30.2',
|
|
7648
|
+
agent: 'git/isomorphic-git@1.30.2',
|
|
7637
7649
|
};
|
|
7638
7650
|
|
|
7639
7651
|
class FIFO {
|
|
@@ -9241,6 +9253,16 @@ async function mergeTree({
|
|
|
9241
9253
|
}
|
|
9242
9254
|
}
|
|
9243
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
|
+
|
|
9244
9266
|
return theirs
|
|
9245
9267
|
? {
|
|
9246
9268
|
mode: await theirs.mode(),
|
|
@@ -9251,6 +9273,16 @@ async function mergeTree({
|
|
|
9251
9273
|
: undefined
|
|
9252
9274
|
}
|
|
9253
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
|
+
|
|
9254
9286
|
return ours
|
|
9255
9287
|
? {
|
|
9256
9288
|
mode: await ours.mode(),
|
|
@@ -15288,11 +15320,9 @@ async function updateIndex({
|
|
|
15288
15320
|
return await GitIndexManager.acquire(
|
|
15289
15321
|
{ fs, gitdir, cache },
|
|
15290
15322
|
async function(index) {
|
|
15291
|
-
let fileStats;
|
|
15292
|
-
|
|
15293
15323
|
if (!force) {
|
|
15294
15324
|
// Check if the file is still present in the working directory
|
|
15295
|
-
fileStats = await fs.lstat(pathBrowserify.join(dir, filepath));
|
|
15325
|
+
const fileStats = await fs.lstat(pathBrowserify.join(dir, filepath));
|
|
15296
15326
|
|
|
15297
15327
|
if (fileStats) {
|
|
15298
15328
|
if (fileStats.isDirectory()) {
|
|
@@ -15342,18 +15372,7 @@ async function updateIndex({
|
|
|
15342
15372
|
)
|
|
15343
15373
|
}
|
|
15344
15374
|
|
|
15345
|
-
|
|
15346
|
-
let stats = {
|
|
15347
|
-
ctime: new Date(0),
|
|
15348
|
-
mtime: new Date(0),
|
|
15349
|
-
dev: 0,
|
|
15350
|
-
ino: 0,
|
|
15351
|
-
mode,
|
|
15352
|
-
uid: 0,
|
|
15353
|
-
gid: 0,
|
|
15354
|
-
size: 0,
|
|
15355
|
-
};
|
|
15356
|
-
|
|
15375
|
+
let stats;
|
|
15357
15376
|
if (!oid) {
|
|
15358
15377
|
stats = fileStats;
|
|
15359
15378
|
|
|
@@ -15369,6 +15388,18 @@ async function updateIndex({
|
|
|
15369
15388
|
format: 'content',
|
|
15370
15389
|
object,
|
|
15371
15390
|
});
|
|
15391
|
+
} else {
|
|
15392
|
+
// By default we use 0 for the stats of the index file
|
|
15393
|
+
stats = {
|
|
15394
|
+
ctime: new Date(0),
|
|
15395
|
+
mtime: new Date(0),
|
|
15396
|
+
dev: 0,
|
|
15397
|
+
ino: 0,
|
|
15398
|
+
mode,
|
|
15399
|
+
uid: 0,
|
|
15400
|
+
gid: 0,
|
|
15401
|
+
size: 0,
|
|
15402
|
+
};
|
|
15372
15403
|
}
|
|
15373
15404
|
|
|
15374
15405
|
index.insert({
|
package/index.js
CHANGED
|
@@ -973,8 +973,11 @@ function createCache() {
|
|
|
973
973
|
}
|
|
974
974
|
|
|
975
975
|
async function updateCachedIndexFile(fs, filepath, cache) {
|
|
976
|
-
const stat = await
|
|
977
|
-
|
|
976
|
+
const [stat, rawIndexFile] = await Promise.all([
|
|
977
|
+
fs.lstat(filepath),
|
|
978
|
+
fs.read(filepath),
|
|
979
|
+
]);
|
|
980
|
+
|
|
978
981
|
const index = await GitIndex.from(rawIndexFile);
|
|
979
982
|
// cache the GitIndex object so we don't need to re-read it every time.
|
|
980
983
|
cache.map.set(filepath, index);
|
|
@@ -986,8 +989,9 @@ async function updateCachedIndexFile(fs, filepath, cache) {
|
|
|
986
989
|
async function isIndexStale(fs, filepath, cache) {
|
|
987
990
|
const savedStats = cache.stats.get(filepath);
|
|
988
991
|
if (savedStats === undefined) return true
|
|
989
|
-
const currStats = await fs.lstat(filepath);
|
|
990
992
|
if (savedStats === null) return false
|
|
993
|
+
|
|
994
|
+
const currStats = await fs.lstat(filepath);
|
|
991
995
|
if (currStats === null) return false
|
|
992
996
|
return compareStats(savedStats, currStats)
|
|
993
997
|
}
|
|
@@ -1003,7 +1007,9 @@ class GitIndexManager {
|
|
|
1003
1007
|
* @param {function(GitIndex): any} closure
|
|
1004
1008
|
*/
|
|
1005
1009
|
static async acquire({ fs, gitdir, cache, allowUnmerged = true }, closure) {
|
|
1006
|
-
if (!cache[IndexCache])
|
|
1010
|
+
if (!cache[IndexCache]) {
|
|
1011
|
+
cache[IndexCache] = createCache();
|
|
1012
|
+
}
|
|
1007
1013
|
|
|
1008
1014
|
const filepath = `${gitdir}/index`;
|
|
1009
1015
|
if (lock === null) lock = new AsyncLock({ maxPending: Infinity });
|
|
@@ -1014,10 +1020,11 @@ class GitIndexManager {
|
|
|
1014
1020
|
// to make sure other processes aren't writing to it
|
|
1015
1021
|
// simultaneously, which could result in a corrupted index.
|
|
1016
1022
|
// const fileLock = await Lock(filepath)
|
|
1017
|
-
|
|
1018
|
-
|
|
1023
|
+
const theIndexCache = cache[IndexCache];
|
|
1024
|
+
if (await isIndexStale(fs, filepath, theIndexCache)) {
|
|
1025
|
+
await updateCachedIndexFile(fs, filepath, theIndexCache);
|
|
1019
1026
|
}
|
|
1020
|
-
const index =
|
|
1027
|
+
const index = theIndexCache.map.get(filepath);
|
|
1021
1028
|
unmergedPaths = index.unmergedPaths;
|
|
1022
1029
|
|
|
1023
1030
|
if (unmergedPaths.length && !allowUnmerged)
|
|
@@ -1030,7 +1037,7 @@ class GitIndexManager {
|
|
|
1030
1037
|
const buffer = await index.toObject();
|
|
1031
1038
|
await fs.write(filepath, buffer);
|
|
1032
1039
|
// Update cached stat value
|
|
1033
|
-
|
|
1040
|
+
theIndexCache.stats.set(filepath, await fs.lstat(filepath));
|
|
1034
1041
|
index._dirty = false;
|
|
1035
1042
|
}
|
|
1036
1043
|
});
|
|
@@ -4255,7 +4262,7 @@ class GitWalkerFs {
|
|
|
4255
4262
|
oid = undefined;
|
|
4256
4263
|
} else {
|
|
4257
4264
|
oid = await shasum(
|
|
4258
|
-
GitObject.wrap({ type: 'blob', object:
|
|
4265
|
+
GitObject.wrap({ type: 'blob', object: content })
|
|
4259
4266
|
);
|
|
4260
4267
|
// Update the stats in the index so we will get a "cache hit" next time
|
|
4261
4268
|
// 1) if we can (because the oid and mode are the same)
|
|
@@ -4446,15 +4453,20 @@ async function _walk({
|
|
|
4446
4453
|
const range = arrayRange(0, walkers.length);
|
|
4447
4454
|
const unionWalkerFromReaddir = async entries => {
|
|
4448
4455
|
range.map(i => {
|
|
4449
|
-
|
|
4456
|
+
const entry = entries[i];
|
|
4457
|
+
entries[i] = entry && new walkers[i].ConstructEntry(entry);
|
|
4450
4458
|
});
|
|
4451
4459
|
const subdirs = await Promise.all(
|
|
4452
|
-
range.map(i =>
|
|
4460
|
+
range.map(i => {
|
|
4461
|
+
const entry = entries[i];
|
|
4462
|
+
return entry ? walkers[i].readdir(entry) : []
|
|
4463
|
+
})
|
|
4453
4464
|
);
|
|
4454
4465
|
// Now process child directories
|
|
4455
|
-
const iterators = subdirs
|
|
4456
|
-
|
|
4457
|
-
|
|
4466
|
+
const iterators = subdirs.map(array => {
|
|
4467
|
+
return (array === null ? [] : array)[Symbol.iterator]()
|
|
4468
|
+
});
|
|
4469
|
+
|
|
4458
4470
|
return {
|
|
4459
4471
|
entries,
|
|
4460
4472
|
children: unionOfIterators(iterators),
|
|
@@ -7626,8 +7638,8 @@ function filterCapabilities(server, client) {
|
|
|
7626
7638
|
|
|
7627
7639
|
const pkg = {
|
|
7628
7640
|
name: 'isomorphic-git',
|
|
7629
|
-
version: '1.30.
|
|
7630
|
-
agent: 'git/isomorphic-git@1.30.
|
|
7641
|
+
version: '1.30.2',
|
|
7642
|
+
agent: 'git/isomorphic-git@1.30.2',
|
|
7631
7643
|
};
|
|
7632
7644
|
|
|
7633
7645
|
class FIFO {
|
|
@@ -9235,6 +9247,16 @@ async function mergeTree({
|
|
|
9235
9247
|
}
|
|
9236
9248
|
}
|
|
9237
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
|
+
|
|
9238
9260
|
return theirs
|
|
9239
9261
|
? {
|
|
9240
9262
|
mode: await theirs.mode(),
|
|
@@ -9245,6 +9267,16 @@ async function mergeTree({
|
|
|
9245
9267
|
: undefined
|
|
9246
9268
|
}
|
|
9247
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
|
+
|
|
9248
9280
|
return ours
|
|
9249
9281
|
? {
|
|
9250
9282
|
mode: await ours.mode(),
|
|
@@ -15282,11 +15314,9 @@ async function updateIndex({
|
|
|
15282
15314
|
return await GitIndexManager.acquire(
|
|
15283
15315
|
{ fs, gitdir, cache },
|
|
15284
15316
|
async function(index) {
|
|
15285
|
-
let fileStats;
|
|
15286
|
-
|
|
15287
15317
|
if (!force) {
|
|
15288
15318
|
// Check if the file is still present in the working directory
|
|
15289
|
-
fileStats = await fs.lstat(join(dir, filepath));
|
|
15319
|
+
const fileStats = await fs.lstat(join(dir, filepath));
|
|
15290
15320
|
|
|
15291
15321
|
if (fileStats) {
|
|
15292
15322
|
if (fileStats.isDirectory()) {
|
|
@@ -15336,18 +15366,7 @@ async function updateIndex({
|
|
|
15336
15366
|
)
|
|
15337
15367
|
}
|
|
15338
15368
|
|
|
15339
|
-
|
|
15340
|
-
let stats = {
|
|
15341
|
-
ctime: new Date(0),
|
|
15342
|
-
mtime: new Date(0),
|
|
15343
|
-
dev: 0,
|
|
15344
|
-
ino: 0,
|
|
15345
|
-
mode,
|
|
15346
|
-
uid: 0,
|
|
15347
|
-
gid: 0,
|
|
15348
|
-
size: 0,
|
|
15349
|
-
};
|
|
15350
|
-
|
|
15369
|
+
let stats;
|
|
15351
15370
|
if (!oid) {
|
|
15352
15371
|
stats = fileStats;
|
|
15353
15372
|
|
|
@@ -15363,6 +15382,18 @@ async function updateIndex({
|
|
|
15363
15382
|
format: 'content',
|
|
15364
15383
|
object,
|
|
15365
15384
|
});
|
|
15385
|
+
} else {
|
|
15386
|
+
// By default we use 0 for the stats of the index file
|
|
15387
|
+
stats = {
|
|
15388
|
+
ctime: new Date(0),
|
|
15389
|
+
mtime: new Date(0),
|
|
15390
|
+
dev: 0,
|
|
15391
|
+
ino: 0,
|
|
15392
|
+
mode,
|
|
15393
|
+
uid: 0,
|
|
15394
|
+
gid: 0,
|
|
15395
|
+
size: 0,
|
|
15396
|
+
};
|
|
15366
15397
|
}
|
|
15367
15398
|
|
|
15368
15399
|
index.insert({
|