isomorphic-git 1.16.0 → 1.17.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 +3 -0
- package/browser-tests.json +6 -6
- package/index.cjs +54 -31
- package/index.d.ts +40 -22
- package/index.js +54 -31
- package/index.umd.min.d.ts +40 -22
- package/index.umd.min.js +2 -2
- package/index.umd.min.js.map +1 -1
- package/package.json +11 -11
- package/size_report.html +1 -1
package/README.md
CHANGED
|
@@ -343,6 +343,9 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
|
|
|
343
343
|
<td align="center"><a href="http://vitorluizc.github.io/"><img src="https://avatars.githubusercontent.com/u/9027363?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Vitor Luiz Cavalcanti</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=VitorLuizC" title="Documentation">📖</a></td>
|
|
344
344
|
<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>
|
|
345
345
|
</tr>
|
|
346
|
+
<tr>
|
|
347
|
+
<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>
|
|
348
|
+
</tr>
|
|
346
349
|
</table>
|
|
347
350
|
|
|
348
351
|
<!-- markdownlint-restore -->
|
package/browser-tests.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
|
-
"
|
|
3
|
-
"Firefox
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
2
|
+
"Chrome Headless 79.0.3945.0 (Linux x86_64)",
|
|
3
|
+
"Firefox 99.0 (Ubuntu 0.0.0)",
|
|
4
|
+
"Safari 13.1 (Mac OS 10.15.4)",
|
|
5
|
+
"Mobile Safari 13.0 (iOS 13.0)",
|
|
6
|
+
"Edge 79.0.309.65 (Windows 10)",
|
|
7
|
+
"Chrome 96.0.4664.104 (Android 10)"
|
|
8
8
|
]
|
package/index.cjs
CHANGED
|
@@ -1474,6 +1474,21 @@ const getPath = (section, subsection, name) => {
|
|
|
1474
1474
|
.join('.')
|
|
1475
1475
|
};
|
|
1476
1476
|
|
|
1477
|
+
const normalizePath$1 = path => {
|
|
1478
|
+
const pathSegments = path.split('.');
|
|
1479
|
+
const section = pathSegments.shift();
|
|
1480
|
+
const name = pathSegments.pop();
|
|
1481
|
+
const subsection = pathSegments.length ? pathSegments.join('.') : undefined;
|
|
1482
|
+
|
|
1483
|
+
return {
|
|
1484
|
+
section,
|
|
1485
|
+
subsection,
|
|
1486
|
+
name,
|
|
1487
|
+
path: getPath(section, subsection, name),
|
|
1488
|
+
sectionPath: getPath(section, subsection, null),
|
|
1489
|
+
}
|
|
1490
|
+
};
|
|
1491
|
+
|
|
1477
1492
|
const findLastIndex = (array, callback) => {
|
|
1478
1493
|
return array.reduce((lastIndex, item, index) => {
|
|
1479
1494
|
return callback(item) ? index : lastIndex
|
|
@@ -1513,8 +1528,9 @@ class GitConfig {
|
|
|
1513
1528
|
}
|
|
1514
1529
|
|
|
1515
1530
|
async get(path, getall = false) {
|
|
1531
|
+
const normalizedPath = normalizePath$1(path).path;
|
|
1516
1532
|
const allValues = this.parsedConfig
|
|
1517
|
-
.filter(config => config.path ===
|
|
1533
|
+
.filter(config => config.path === normalizedPath)
|
|
1518
1534
|
.map(({ section, name, value }) => {
|
|
1519
1535
|
const fn = schema[section] && schema[section][name];
|
|
1520
1536
|
return fn ? fn(value) : value
|
|
@@ -1544,9 +1560,16 @@ class GitConfig {
|
|
|
1544
1560
|
}
|
|
1545
1561
|
|
|
1546
1562
|
async set(path, value, append = false) {
|
|
1563
|
+
const {
|
|
1564
|
+
section,
|
|
1565
|
+
subsection,
|
|
1566
|
+
name,
|
|
1567
|
+
path: normalizedPath,
|
|
1568
|
+
sectionPath,
|
|
1569
|
+
} = normalizePath$1(path);
|
|
1547
1570
|
const configIndex = findLastIndex(
|
|
1548
1571
|
this.parsedConfig,
|
|
1549
|
-
config => config.path ===
|
|
1572
|
+
config => config.path === normalizedPath
|
|
1550
1573
|
);
|
|
1551
1574
|
if (value == null) {
|
|
1552
1575
|
if (configIndex !== -1) {
|
|
@@ -1555,7 +1578,9 @@ class GitConfig {
|
|
|
1555
1578
|
} else {
|
|
1556
1579
|
if (configIndex !== -1) {
|
|
1557
1580
|
const config = this.parsedConfig[configIndex];
|
|
1581
|
+
// Name should be overwritten in case the casing changed
|
|
1558
1582
|
const modifiedConfig = Object.assign({}, config, {
|
|
1583
|
+
name,
|
|
1559
1584
|
value,
|
|
1560
1585
|
modified: true,
|
|
1561
1586
|
});
|
|
@@ -1565,13 +1590,6 @@ class GitConfig {
|
|
|
1565
1590
|
this.parsedConfig[configIndex] = modifiedConfig;
|
|
1566
1591
|
}
|
|
1567
1592
|
} else {
|
|
1568
|
-
const pathSegments = path.split('.');
|
|
1569
|
-
const section = pathSegments.shift().toLowerCase();
|
|
1570
|
-
const name = pathSegments.pop();
|
|
1571
|
-
const subsection = pathSegments.length
|
|
1572
|
-
? pathSegments.join('.').toLowerCase()
|
|
1573
|
-
: undefined;
|
|
1574
|
-
const sectionPath = subsection ? section + '.' + subsection : section;
|
|
1575
1593
|
const sectionIndex = this.parsedConfig.findIndex(
|
|
1576
1594
|
config => config.path === sectionPath
|
|
1577
1595
|
);
|
|
@@ -1581,7 +1599,7 @@ class GitConfig {
|
|
|
1581
1599
|
name,
|
|
1582
1600
|
value,
|
|
1583
1601
|
modified: true,
|
|
1584
|
-
path:
|
|
1602
|
+
path: normalizedPath,
|
|
1585
1603
|
};
|
|
1586
1604
|
if (SECTION_REGEX.test(section) && VARIABLE_NAME_REGEX.test(name)) {
|
|
1587
1605
|
if (sectionIndex >= 0) {
|
|
@@ -1593,7 +1611,7 @@ class GitConfig {
|
|
|
1593
1611
|
section,
|
|
1594
1612
|
subsection,
|
|
1595
1613
|
modified: true,
|
|
1596
|
-
path:
|
|
1614
|
+
path: sectionPath,
|
|
1597
1615
|
};
|
|
1598
1616
|
this.parsedConfig.push(newSection, newConfig);
|
|
1599
1617
|
}
|
|
@@ -1609,6 +1627,10 @@ class GitConfig {
|
|
|
1609
1627
|
return line
|
|
1610
1628
|
}
|
|
1611
1629
|
if (name != null && value != null) {
|
|
1630
|
+
if (typeof value === 'string' && /[#;]/.test(value)) {
|
|
1631
|
+
// A `#` or `;` symbol denotes a comment, so we have to wrap it in double quotes
|
|
1632
|
+
return `\t${name} = "${value}"`
|
|
1633
|
+
}
|
|
1612
1634
|
return `\t${name} = ${value}`
|
|
1613
1635
|
}
|
|
1614
1636
|
if (subsection != null) {
|
|
@@ -3210,6 +3232,23 @@ class MissingParameterError extends BaseError {
|
|
|
3210
3232
|
/** @type {'MissingParameterError'} */
|
|
3211
3233
|
MissingParameterError.code = 'MissingParameterError';
|
|
3212
3234
|
|
|
3235
|
+
class MultipleGitError extends BaseError {
|
|
3236
|
+
/**
|
|
3237
|
+
* @param {Error[]} errors
|
|
3238
|
+
* @param {string} message
|
|
3239
|
+
*/
|
|
3240
|
+
constructor(errors) {
|
|
3241
|
+
super(
|
|
3242
|
+
`There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more`
|
|
3243
|
+
);
|
|
3244
|
+
this.code = this.name = MultipleGitError.code;
|
|
3245
|
+
this.data = { errors };
|
|
3246
|
+
this.errors = errors;
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
/** @type {'MultipleGitError'} */
|
|
3250
|
+
MultipleGitError.code = 'MultipleGitError';
|
|
3251
|
+
|
|
3213
3252
|
class ParseError extends BaseError {
|
|
3214
3253
|
/**
|
|
3215
3254
|
* @param {string} expected
|
|
@@ -3335,6 +3374,7 @@ var Errors = /*#__PURE__*/Object.freeze({
|
|
|
3335
3374
|
MergeNotSupportedError: MergeNotSupportedError,
|
|
3336
3375
|
MissingNameError: MissingNameError,
|
|
3337
3376
|
MissingParameterError: MissingParameterError,
|
|
3377
|
+
MultipleGitError: MultipleGitError,
|
|
3338
3378
|
NoRefspecError: NoRefspecError,
|
|
3339
3379
|
NotFoundError: NotFoundError,
|
|
3340
3380
|
ObjectTypeError: ObjectTypeError,
|
|
@@ -4029,23 +4069,6 @@ function WORKDIR() {
|
|
|
4029
4069
|
|
|
4030
4070
|
// @ts-check
|
|
4031
4071
|
|
|
4032
|
-
class MultipleGitError extends BaseError {
|
|
4033
|
-
/**
|
|
4034
|
-
* @param {Error[]} errors
|
|
4035
|
-
* @param {string} message
|
|
4036
|
-
*/
|
|
4037
|
-
constructor(errors) {
|
|
4038
|
-
super(
|
|
4039
|
-
`There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more`
|
|
4040
|
-
);
|
|
4041
|
-
this.code = this.name = MultipleGitError.code;
|
|
4042
|
-
this.data = { errors };
|
|
4043
|
-
this.errors = errors;
|
|
4044
|
-
}
|
|
4045
|
-
}
|
|
4046
|
-
/** @type {'MultipleGitError'} */
|
|
4047
|
-
MultipleGitError.code = 'MultipleGitError';
|
|
4048
|
-
|
|
4049
4072
|
// I'm putting this in a Manager because I reckon it could benefit
|
|
4050
4073
|
// from a LOT of cacheing.
|
|
4051
4074
|
class GitIgnoreManager {
|
|
@@ -4469,7 +4492,7 @@ async function add({
|
|
|
4469
4492
|
assertParameter('fs', _fs);
|
|
4470
4493
|
assertParameter('dir', dir);
|
|
4471
4494
|
assertParameter('gitdir', gitdir);
|
|
4472
|
-
assertParameter('
|
|
4495
|
+
assertParameter('filepath', filepath);
|
|
4473
4496
|
|
|
4474
4497
|
const fs = new FileSystem(_fs);
|
|
4475
4498
|
await GitIndexManager.acquire({ fs, gitdir, cache }, async index => {
|
|
@@ -6923,8 +6946,8 @@ function filterCapabilities(server, client) {
|
|
|
6923
6946
|
|
|
6924
6947
|
const pkg = {
|
|
6925
6948
|
name: 'isomorphic-git',
|
|
6926
|
-
version: '1.
|
|
6927
|
-
agent: 'git/isomorphic-git@1.
|
|
6949
|
+
version: '1.17.2',
|
|
6950
|
+
agent: 'git/isomorphic-git@1.17.2',
|
|
6928
6951
|
};
|
|
6929
6952
|
|
|
6930
6953
|
class FIFO {
|
package/index.d.ts
CHANGED
|
@@ -717,6 +717,7 @@ export var Errors: Readonly<{
|
|
|
717
717
|
MergeNotSupportedError: typeof MergeNotSupportedError;
|
|
718
718
|
MissingNameError: typeof MissingNameError;
|
|
719
719
|
MissingParameterError: typeof MissingParameterError;
|
|
720
|
+
MultipleGitError: typeof MultipleGitError;
|
|
720
721
|
NoRefspecError: typeof NoRefspecError;
|
|
721
722
|
NotFoundError: typeof NotFoundError;
|
|
722
723
|
ObjectTypeError: typeof ObjectTypeError;
|
|
@@ -3893,6 +3894,23 @@ declare namespace MissingParameterError {
|
|
|
3893
3894
|
const code_15: 'MissingParameterError';
|
|
3894
3895
|
export { code_15 as code };
|
|
3895
3896
|
}
|
|
3897
|
+
declare class MultipleGitError extends BaseError {
|
|
3898
|
+
/**
|
|
3899
|
+
* @param {Error[]} errors
|
|
3900
|
+
* @param {string} message
|
|
3901
|
+
*/
|
|
3902
|
+
constructor(errors: Error[]);
|
|
3903
|
+
code: "MultipleGitError";
|
|
3904
|
+
name: "MultipleGitError";
|
|
3905
|
+
data: {
|
|
3906
|
+
errors: Error[];
|
|
3907
|
+
};
|
|
3908
|
+
errors: Error[];
|
|
3909
|
+
}
|
|
3910
|
+
declare namespace MultipleGitError {
|
|
3911
|
+
const code_16: 'MultipleGitError';
|
|
3912
|
+
export { code_16 as code };
|
|
3913
|
+
}
|
|
3896
3914
|
declare class NoRefspecError extends BaseError {
|
|
3897
3915
|
/**
|
|
3898
3916
|
* @param {string} remote
|
|
@@ -3905,8 +3923,8 @@ declare class NoRefspecError extends BaseError {
|
|
|
3905
3923
|
};
|
|
3906
3924
|
}
|
|
3907
3925
|
declare namespace NoRefspecError {
|
|
3908
|
-
const
|
|
3909
|
-
export {
|
|
3926
|
+
const code_17: 'NoRefspecError';
|
|
3927
|
+
export { code_17 as code };
|
|
3910
3928
|
}
|
|
3911
3929
|
declare class NotFoundError extends BaseError {
|
|
3912
3930
|
/**
|
|
@@ -3920,8 +3938,8 @@ declare class NotFoundError extends BaseError {
|
|
|
3920
3938
|
};
|
|
3921
3939
|
}
|
|
3922
3940
|
declare namespace NotFoundError {
|
|
3923
|
-
const
|
|
3924
|
-
export {
|
|
3941
|
+
const code_18: 'NotFoundError';
|
|
3942
|
+
export { code_18 as code };
|
|
3925
3943
|
}
|
|
3926
3944
|
declare class ObjectTypeError extends BaseError {
|
|
3927
3945
|
/**
|
|
@@ -3941,8 +3959,8 @@ declare class ObjectTypeError extends BaseError {
|
|
|
3941
3959
|
};
|
|
3942
3960
|
}
|
|
3943
3961
|
declare namespace ObjectTypeError {
|
|
3944
|
-
const
|
|
3945
|
-
export {
|
|
3962
|
+
const code_19: 'ObjectTypeError';
|
|
3963
|
+
export { code_19 as code };
|
|
3946
3964
|
}
|
|
3947
3965
|
declare class ParseError extends BaseError {
|
|
3948
3966
|
/**
|
|
@@ -3958,8 +3976,8 @@ declare class ParseError extends BaseError {
|
|
|
3958
3976
|
};
|
|
3959
3977
|
}
|
|
3960
3978
|
declare namespace ParseError {
|
|
3961
|
-
const
|
|
3962
|
-
export {
|
|
3979
|
+
const code_20: 'ParseError';
|
|
3980
|
+
export { code_20 as code };
|
|
3963
3981
|
}
|
|
3964
3982
|
declare class PushRejectedError extends BaseError {
|
|
3965
3983
|
/**
|
|
@@ -3973,8 +3991,8 @@ declare class PushRejectedError extends BaseError {
|
|
|
3973
3991
|
};
|
|
3974
3992
|
}
|
|
3975
3993
|
declare namespace PushRejectedError {
|
|
3976
|
-
const
|
|
3977
|
-
export {
|
|
3994
|
+
const code_21: 'PushRejectedError';
|
|
3995
|
+
export { code_21 as code };
|
|
3978
3996
|
}
|
|
3979
3997
|
declare class RemoteCapabilityError extends BaseError {
|
|
3980
3998
|
/**
|
|
@@ -3990,8 +4008,8 @@ declare class RemoteCapabilityError extends BaseError {
|
|
|
3990
4008
|
};
|
|
3991
4009
|
}
|
|
3992
4010
|
declare namespace RemoteCapabilityError {
|
|
3993
|
-
const
|
|
3994
|
-
export {
|
|
4011
|
+
const code_22: 'RemoteCapabilityError';
|
|
4012
|
+
export { code_22 as code };
|
|
3995
4013
|
}
|
|
3996
4014
|
declare class SmartHttpError extends BaseError {
|
|
3997
4015
|
/**
|
|
@@ -4007,8 +4025,8 @@ declare class SmartHttpError extends BaseError {
|
|
|
4007
4025
|
};
|
|
4008
4026
|
}
|
|
4009
4027
|
declare namespace SmartHttpError {
|
|
4010
|
-
const
|
|
4011
|
-
export {
|
|
4028
|
+
const code_23: 'SmartHttpError';
|
|
4029
|
+
export { code_23 as code };
|
|
4012
4030
|
}
|
|
4013
4031
|
declare class UnknownTransportError extends BaseError {
|
|
4014
4032
|
/**
|
|
@@ -4026,8 +4044,8 @@ declare class UnknownTransportError extends BaseError {
|
|
|
4026
4044
|
};
|
|
4027
4045
|
}
|
|
4028
4046
|
declare namespace UnknownTransportError {
|
|
4029
|
-
const
|
|
4030
|
-
export {
|
|
4047
|
+
const code_24: 'UnknownTransportError';
|
|
4048
|
+
export { code_24 as code };
|
|
4031
4049
|
}
|
|
4032
4050
|
declare class UnsafeFilepathError extends BaseError {
|
|
4033
4051
|
/**
|
|
@@ -4041,8 +4059,8 @@ declare class UnsafeFilepathError extends BaseError {
|
|
|
4041
4059
|
};
|
|
4042
4060
|
}
|
|
4043
4061
|
declare namespace UnsafeFilepathError {
|
|
4044
|
-
const
|
|
4045
|
-
export {
|
|
4062
|
+
const code_25: 'UnsafeFilepathError';
|
|
4063
|
+
export { code_25 as code };
|
|
4046
4064
|
}
|
|
4047
4065
|
declare class UrlParseError extends BaseError {
|
|
4048
4066
|
/**
|
|
@@ -4056,8 +4074,8 @@ declare class UrlParseError extends BaseError {
|
|
|
4056
4074
|
};
|
|
4057
4075
|
}
|
|
4058
4076
|
declare namespace UrlParseError {
|
|
4059
|
-
const
|
|
4060
|
-
export {
|
|
4077
|
+
const code_26: 'UrlParseError';
|
|
4078
|
+
export { code_26 as code };
|
|
4061
4079
|
}
|
|
4062
4080
|
declare class UserCanceledError extends BaseError {
|
|
4063
4081
|
code: "UserCanceledError";
|
|
@@ -4065,8 +4083,8 @@ declare class UserCanceledError extends BaseError {
|
|
|
4065
4083
|
data: {};
|
|
4066
4084
|
}
|
|
4067
4085
|
declare namespace UserCanceledError {
|
|
4068
|
-
const
|
|
4069
|
-
export {
|
|
4086
|
+
const code_27: 'UserCanceledError';
|
|
4087
|
+
export { code_27 as code };
|
|
4070
4088
|
}
|
|
4071
4089
|
/**
|
|
4072
4090
|
* @typedef {Object} GitProgressEvent
|
package/index.js
CHANGED
|
@@ -1468,6 +1468,21 @@ const getPath = (section, subsection, name) => {
|
|
|
1468
1468
|
.join('.')
|
|
1469
1469
|
};
|
|
1470
1470
|
|
|
1471
|
+
const normalizePath$1 = path => {
|
|
1472
|
+
const pathSegments = path.split('.');
|
|
1473
|
+
const section = pathSegments.shift();
|
|
1474
|
+
const name = pathSegments.pop();
|
|
1475
|
+
const subsection = pathSegments.length ? pathSegments.join('.') : undefined;
|
|
1476
|
+
|
|
1477
|
+
return {
|
|
1478
|
+
section,
|
|
1479
|
+
subsection,
|
|
1480
|
+
name,
|
|
1481
|
+
path: getPath(section, subsection, name),
|
|
1482
|
+
sectionPath: getPath(section, subsection, null),
|
|
1483
|
+
}
|
|
1484
|
+
};
|
|
1485
|
+
|
|
1471
1486
|
const findLastIndex = (array, callback) => {
|
|
1472
1487
|
return array.reduce((lastIndex, item, index) => {
|
|
1473
1488
|
return callback(item) ? index : lastIndex
|
|
@@ -1507,8 +1522,9 @@ class GitConfig {
|
|
|
1507
1522
|
}
|
|
1508
1523
|
|
|
1509
1524
|
async get(path, getall = false) {
|
|
1525
|
+
const normalizedPath = normalizePath$1(path).path;
|
|
1510
1526
|
const allValues = this.parsedConfig
|
|
1511
|
-
.filter(config => config.path ===
|
|
1527
|
+
.filter(config => config.path === normalizedPath)
|
|
1512
1528
|
.map(({ section, name, value }) => {
|
|
1513
1529
|
const fn = schema[section] && schema[section][name];
|
|
1514
1530
|
return fn ? fn(value) : value
|
|
@@ -1538,9 +1554,16 @@ class GitConfig {
|
|
|
1538
1554
|
}
|
|
1539
1555
|
|
|
1540
1556
|
async set(path, value, append = false) {
|
|
1557
|
+
const {
|
|
1558
|
+
section,
|
|
1559
|
+
subsection,
|
|
1560
|
+
name,
|
|
1561
|
+
path: normalizedPath,
|
|
1562
|
+
sectionPath,
|
|
1563
|
+
} = normalizePath$1(path);
|
|
1541
1564
|
const configIndex = findLastIndex(
|
|
1542
1565
|
this.parsedConfig,
|
|
1543
|
-
config => config.path ===
|
|
1566
|
+
config => config.path === normalizedPath
|
|
1544
1567
|
);
|
|
1545
1568
|
if (value == null) {
|
|
1546
1569
|
if (configIndex !== -1) {
|
|
@@ -1549,7 +1572,9 @@ class GitConfig {
|
|
|
1549
1572
|
} else {
|
|
1550
1573
|
if (configIndex !== -1) {
|
|
1551
1574
|
const config = this.parsedConfig[configIndex];
|
|
1575
|
+
// Name should be overwritten in case the casing changed
|
|
1552
1576
|
const modifiedConfig = Object.assign({}, config, {
|
|
1577
|
+
name,
|
|
1553
1578
|
value,
|
|
1554
1579
|
modified: true,
|
|
1555
1580
|
});
|
|
@@ -1559,13 +1584,6 @@ class GitConfig {
|
|
|
1559
1584
|
this.parsedConfig[configIndex] = modifiedConfig;
|
|
1560
1585
|
}
|
|
1561
1586
|
} else {
|
|
1562
|
-
const pathSegments = path.split('.');
|
|
1563
|
-
const section = pathSegments.shift().toLowerCase();
|
|
1564
|
-
const name = pathSegments.pop();
|
|
1565
|
-
const subsection = pathSegments.length
|
|
1566
|
-
? pathSegments.join('.').toLowerCase()
|
|
1567
|
-
: undefined;
|
|
1568
|
-
const sectionPath = subsection ? section + '.' + subsection : section;
|
|
1569
1587
|
const sectionIndex = this.parsedConfig.findIndex(
|
|
1570
1588
|
config => config.path === sectionPath
|
|
1571
1589
|
);
|
|
@@ -1575,7 +1593,7 @@ class GitConfig {
|
|
|
1575
1593
|
name,
|
|
1576
1594
|
value,
|
|
1577
1595
|
modified: true,
|
|
1578
|
-
path:
|
|
1596
|
+
path: normalizedPath,
|
|
1579
1597
|
};
|
|
1580
1598
|
if (SECTION_REGEX.test(section) && VARIABLE_NAME_REGEX.test(name)) {
|
|
1581
1599
|
if (sectionIndex >= 0) {
|
|
@@ -1587,7 +1605,7 @@ class GitConfig {
|
|
|
1587
1605
|
section,
|
|
1588
1606
|
subsection,
|
|
1589
1607
|
modified: true,
|
|
1590
|
-
path:
|
|
1608
|
+
path: sectionPath,
|
|
1591
1609
|
};
|
|
1592
1610
|
this.parsedConfig.push(newSection, newConfig);
|
|
1593
1611
|
}
|
|
@@ -1603,6 +1621,10 @@ class GitConfig {
|
|
|
1603
1621
|
return line
|
|
1604
1622
|
}
|
|
1605
1623
|
if (name != null && value != null) {
|
|
1624
|
+
if (typeof value === 'string' && /[#;]/.test(value)) {
|
|
1625
|
+
// A `#` or `;` symbol denotes a comment, so we have to wrap it in double quotes
|
|
1626
|
+
return `\t${name} = "${value}"`
|
|
1627
|
+
}
|
|
1606
1628
|
return `\t${name} = ${value}`
|
|
1607
1629
|
}
|
|
1608
1630
|
if (subsection != null) {
|
|
@@ -3204,6 +3226,23 @@ class MissingParameterError extends BaseError {
|
|
|
3204
3226
|
/** @type {'MissingParameterError'} */
|
|
3205
3227
|
MissingParameterError.code = 'MissingParameterError';
|
|
3206
3228
|
|
|
3229
|
+
class MultipleGitError extends BaseError {
|
|
3230
|
+
/**
|
|
3231
|
+
* @param {Error[]} errors
|
|
3232
|
+
* @param {string} message
|
|
3233
|
+
*/
|
|
3234
|
+
constructor(errors) {
|
|
3235
|
+
super(
|
|
3236
|
+
`There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more`
|
|
3237
|
+
);
|
|
3238
|
+
this.code = this.name = MultipleGitError.code;
|
|
3239
|
+
this.data = { errors };
|
|
3240
|
+
this.errors = errors;
|
|
3241
|
+
}
|
|
3242
|
+
}
|
|
3243
|
+
/** @type {'MultipleGitError'} */
|
|
3244
|
+
MultipleGitError.code = 'MultipleGitError';
|
|
3245
|
+
|
|
3207
3246
|
class ParseError extends BaseError {
|
|
3208
3247
|
/**
|
|
3209
3248
|
* @param {string} expected
|
|
@@ -3329,6 +3368,7 @@ var Errors = /*#__PURE__*/Object.freeze({
|
|
|
3329
3368
|
MergeNotSupportedError: MergeNotSupportedError,
|
|
3330
3369
|
MissingNameError: MissingNameError,
|
|
3331
3370
|
MissingParameterError: MissingParameterError,
|
|
3371
|
+
MultipleGitError: MultipleGitError,
|
|
3332
3372
|
NoRefspecError: NoRefspecError,
|
|
3333
3373
|
NotFoundError: NotFoundError,
|
|
3334
3374
|
ObjectTypeError: ObjectTypeError,
|
|
@@ -4023,23 +4063,6 @@ function WORKDIR() {
|
|
|
4023
4063
|
|
|
4024
4064
|
// @ts-check
|
|
4025
4065
|
|
|
4026
|
-
class MultipleGitError extends BaseError {
|
|
4027
|
-
/**
|
|
4028
|
-
* @param {Error[]} errors
|
|
4029
|
-
* @param {string} message
|
|
4030
|
-
*/
|
|
4031
|
-
constructor(errors) {
|
|
4032
|
-
super(
|
|
4033
|
-
`There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more`
|
|
4034
|
-
);
|
|
4035
|
-
this.code = this.name = MultipleGitError.code;
|
|
4036
|
-
this.data = { errors };
|
|
4037
|
-
this.errors = errors;
|
|
4038
|
-
}
|
|
4039
|
-
}
|
|
4040
|
-
/** @type {'MultipleGitError'} */
|
|
4041
|
-
MultipleGitError.code = 'MultipleGitError';
|
|
4042
|
-
|
|
4043
4066
|
// I'm putting this in a Manager because I reckon it could benefit
|
|
4044
4067
|
// from a LOT of cacheing.
|
|
4045
4068
|
class GitIgnoreManager {
|
|
@@ -4463,7 +4486,7 @@ async function add({
|
|
|
4463
4486
|
assertParameter('fs', _fs);
|
|
4464
4487
|
assertParameter('dir', dir);
|
|
4465
4488
|
assertParameter('gitdir', gitdir);
|
|
4466
|
-
assertParameter('
|
|
4489
|
+
assertParameter('filepath', filepath);
|
|
4467
4490
|
|
|
4468
4491
|
const fs = new FileSystem(_fs);
|
|
4469
4492
|
await GitIndexManager.acquire({ fs, gitdir, cache }, async index => {
|
|
@@ -6917,8 +6940,8 @@ function filterCapabilities(server, client) {
|
|
|
6917
6940
|
|
|
6918
6941
|
const pkg = {
|
|
6919
6942
|
name: 'isomorphic-git',
|
|
6920
|
-
version: '1.
|
|
6921
|
-
agent: 'git/isomorphic-git@1.
|
|
6943
|
+
version: '1.17.2',
|
|
6944
|
+
agent: 'git/isomorphic-git@1.17.2',
|
|
6922
6945
|
};
|
|
6923
6946
|
|
|
6924
6947
|
class FIFO {
|
package/index.umd.min.d.ts
CHANGED
|
@@ -717,6 +717,7 @@ export var Errors: Readonly<{
|
|
|
717
717
|
MergeNotSupportedError: typeof MergeNotSupportedError;
|
|
718
718
|
MissingNameError: typeof MissingNameError;
|
|
719
719
|
MissingParameterError: typeof MissingParameterError;
|
|
720
|
+
MultipleGitError: typeof MultipleGitError;
|
|
720
721
|
NoRefspecError: typeof NoRefspecError;
|
|
721
722
|
NotFoundError: typeof NotFoundError;
|
|
722
723
|
ObjectTypeError: typeof ObjectTypeError;
|
|
@@ -3893,6 +3894,23 @@ declare namespace MissingParameterError {
|
|
|
3893
3894
|
const code_15: 'MissingParameterError';
|
|
3894
3895
|
export { code_15 as code };
|
|
3895
3896
|
}
|
|
3897
|
+
declare class MultipleGitError extends BaseError {
|
|
3898
|
+
/**
|
|
3899
|
+
* @param {Error[]} errors
|
|
3900
|
+
* @param {string} message
|
|
3901
|
+
*/
|
|
3902
|
+
constructor(errors: Error[]);
|
|
3903
|
+
code: "MultipleGitError";
|
|
3904
|
+
name: "MultipleGitError";
|
|
3905
|
+
data: {
|
|
3906
|
+
errors: Error[];
|
|
3907
|
+
};
|
|
3908
|
+
errors: Error[];
|
|
3909
|
+
}
|
|
3910
|
+
declare namespace MultipleGitError {
|
|
3911
|
+
const code_16: 'MultipleGitError';
|
|
3912
|
+
export { code_16 as code };
|
|
3913
|
+
}
|
|
3896
3914
|
declare class NoRefspecError extends BaseError {
|
|
3897
3915
|
/**
|
|
3898
3916
|
* @param {string} remote
|
|
@@ -3905,8 +3923,8 @@ declare class NoRefspecError extends BaseError {
|
|
|
3905
3923
|
};
|
|
3906
3924
|
}
|
|
3907
3925
|
declare namespace NoRefspecError {
|
|
3908
|
-
const
|
|
3909
|
-
export {
|
|
3926
|
+
const code_17: 'NoRefspecError';
|
|
3927
|
+
export { code_17 as code };
|
|
3910
3928
|
}
|
|
3911
3929
|
declare class NotFoundError extends BaseError {
|
|
3912
3930
|
/**
|
|
@@ -3920,8 +3938,8 @@ declare class NotFoundError extends BaseError {
|
|
|
3920
3938
|
};
|
|
3921
3939
|
}
|
|
3922
3940
|
declare namespace NotFoundError {
|
|
3923
|
-
const
|
|
3924
|
-
export {
|
|
3941
|
+
const code_18: 'NotFoundError';
|
|
3942
|
+
export { code_18 as code };
|
|
3925
3943
|
}
|
|
3926
3944
|
declare class ObjectTypeError extends BaseError {
|
|
3927
3945
|
/**
|
|
@@ -3941,8 +3959,8 @@ declare class ObjectTypeError extends BaseError {
|
|
|
3941
3959
|
};
|
|
3942
3960
|
}
|
|
3943
3961
|
declare namespace ObjectTypeError {
|
|
3944
|
-
const
|
|
3945
|
-
export {
|
|
3962
|
+
const code_19: 'ObjectTypeError';
|
|
3963
|
+
export { code_19 as code };
|
|
3946
3964
|
}
|
|
3947
3965
|
declare class ParseError extends BaseError {
|
|
3948
3966
|
/**
|
|
@@ -3958,8 +3976,8 @@ declare class ParseError extends BaseError {
|
|
|
3958
3976
|
};
|
|
3959
3977
|
}
|
|
3960
3978
|
declare namespace ParseError {
|
|
3961
|
-
const
|
|
3962
|
-
export {
|
|
3979
|
+
const code_20: 'ParseError';
|
|
3980
|
+
export { code_20 as code };
|
|
3963
3981
|
}
|
|
3964
3982
|
declare class PushRejectedError extends BaseError {
|
|
3965
3983
|
/**
|
|
@@ -3973,8 +3991,8 @@ declare class PushRejectedError extends BaseError {
|
|
|
3973
3991
|
};
|
|
3974
3992
|
}
|
|
3975
3993
|
declare namespace PushRejectedError {
|
|
3976
|
-
const
|
|
3977
|
-
export {
|
|
3994
|
+
const code_21: 'PushRejectedError';
|
|
3995
|
+
export { code_21 as code };
|
|
3978
3996
|
}
|
|
3979
3997
|
declare class RemoteCapabilityError extends BaseError {
|
|
3980
3998
|
/**
|
|
@@ -3990,8 +4008,8 @@ declare class RemoteCapabilityError extends BaseError {
|
|
|
3990
4008
|
};
|
|
3991
4009
|
}
|
|
3992
4010
|
declare namespace RemoteCapabilityError {
|
|
3993
|
-
const
|
|
3994
|
-
export {
|
|
4011
|
+
const code_22: 'RemoteCapabilityError';
|
|
4012
|
+
export { code_22 as code };
|
|
3995
4013
|
}
|
|
3996
4014
|
declare class SmartHttpError extends BaseError {
|
|
3997
4015
|
/**
|
|
@@ -4007,8 +4025,8 @@ declare class SmartHttpError extends BaseError {
|
|
|
4007
4025
|
};
|
|
4008
4026
|
}
|
|
4009
4027
|
declare namespace SmartHttpError {
|
|
4010
|
-
const
|
|
4011
|
-
export {
|
|
4028
|
+
const code_23: 'SmartHttpError';
|
|
4029
|
+
export { code_23 as code };
|
|
4012
4030
|
}
|
|
4013
4031
|
declare class UnknownTransportError extends BaseError {
|
|
4014
4032
|
/**
|
|
@@ -4026,8 +4044,8 @@ declare class UnknownTransportError extends BaseError {
|
|
|
4026
4044
|
};
|
|
4027
4045
|
}
|
|
4028
4046
|
declare namespace UnknownTransportError {
|
|
4029
|
-
const
|
|
4030
|
-
export {
|
|
4047
|
+
const code_24: 'UnknownTransportError';
|
|
4048
|
+
export { code_24 as code };
|
|
4031
4049
|
}
|
|
4032
4050
|
declare class UnsafeFilepathError extends BaseError {
|
|
4033
4051
|
/**
|
|
@@ -4041,8 +4059,8 @@ declare class UnsafeFilepathError extends BaseError {
|
|
|
4041
4059
|
};
|
|
4042
4060
|
}
|
|
4043
4061
|
declare namespace UnsafeFilepathError {
|
|
4044
|
-
const
|
|
4045
|
-
export {
|
|
4062
|
+
const code_25: 'UnsafeFilepathError';
|
|
4063
|
+
export { code_25 as code };
|
|
4046
4064
|
}
|
|
4047
4065
|
declare class UrlParseError extends BaseError {
|
|
4048
4066
|
/**
|
|
@@ -4056,8 +4074,8 @@ declare class UrlParseError extends BaseError {
|
|
|
4056
4074
|
};
|
|
4057
4075
|
}
|
|
4058
4076
|
declare namespace UrlParseError {
|
|
4059
|
-
const
|
|
4060
|
-
export {
|
|
4077
|
+
const code_26: 'UrlParseError';
|
|
4078
|
+
export { code_26 as code };
|
|
4061
4079
|
}
|
|
4062
4080
|
declare class UserCanceledError extends BaseError {
|
|
4063
4081
|
code: "UserCanceledError";
|
|
@@ -4065,8 +4083,8 @@ declare class UserCanceledError extends BaseError {
|
|
|
4065
4083
|
data: {};
|
|
4066
4084
|
}
|
|
4067
4085
|
declare namespace UserCanceledError {
|
|
4068
|
-
const
|
|
4069
|
-
export {
|
|
4086
|
+
const code_27: 'UserCanceledError';
|
|
4087
|
+
export { code_27 as code };
|
|
4070
4088
|
}
|
|
4071
4089
|
/**
|
|
4072
4090
|
* @typedef {Object} GitProgressEvent
|