isomorphic-git 1.10.3 → 1.11.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/README.md +1 -1
- package/browser-tests.json +4 -4
- package/index.cjs +22 -15
- package/index.d.ts +3 -1
- package/index.js +22 -15
- package/index.umd.min.d.ts +3 -1
- package/index.umd.min.js +1 -1
- package/index.umd.min.js.map +1 -1
- package/package.json +3 -3
- package/size_report.html +1 -1
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ The following environments are tested in CI and will continue to be supported un
|
|
|
27
27
|
<td align="center"><img src="https://raw.githubusercontent.com/alrra/browser-logos/bc47e4601d2c1fd46a7912f9aed5cdda4afdb301/src/edge/edge.svg?sanitize=true" alt="" width="64" height="64"><br> Edge 79</td>
|
|
28
28
|
<td align="center"><img src="https://raw.githubusercontent.com/alrra/browser-logos/bc47e4601d2c1fd46a7912f9aed5cdda4afdb301/src/firefox/firefox.svg?sanitize=true" alt="" width="64" height="64"><br> Firefox 72</td>
|
|
29
29
|
<td align="center"><img src="https://raw.githubusercontent.com/alrra/browser-logos/bc47e4601d2c1fd46a7912f9aed5cdda4afdb301/src/safari/safari_64x64.png" alt="" width="64" height="64"><br> Safari 13</td>
|
|
30
|
-
<td align="center"><img src="https://upload.wikimedia.org/wikipedia/commons/
|
|
30
|
+
<td align="center"><img src="https://upload.wikimedia.org/wikipedia/commons/6/64/Android_logo_2019_%28stacked%29.svg" alt="" width="64" height="64"><br> Android 10</td>
|
|
31
31
|
<td align="center"><img src="https://upload.wikimedia.org/wikipedia/commons/d/d6/IOS_13_logo.svg" alt="" width="64" height="64"><br> iOS 13</td>
|
|
32
32
|
</tr>
|
|
33
33
|
</table>
|
package/browser-tests.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
"HeadlessChrome 0.0.0 (Linux 0.0.0)",
|
|
3
|
-
"Firefox
|
|
4
|
-
"Chrome Mobile
|
|
3
|
+
"Firefox 96.0.0 (Ubuntu 0.0.0)",
|
|
4
|
+
"Chrome Mobile 96.0.4664 (Android 0.0.0)",
|
|
5
5
|
"Chrome 79.0.3945 (Windows 10 0.0.0)",
|
|
6
|
-
"Safari 13.
|
|
7
|
-
"
|
|
6
|
+
"Mobile Safari 13.0.0 (iOS 13.0.0)",
|
|
7
|
+
"Safari 13.1.0 (Mac OS X 10.15.4)"
|
|
8
8
|
]
|
package/index.cjs
CHANGED
|
@@ -1559,16 +1559,16 @@ class GitConfig {
|
|
|
1559
1559
|
this.parsedConfig[configIndex] = modifiedConfig;
|
|
1560
1560
|
}
|
|
1561
1561
|
} else {
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
.toLowerCase()
|
|
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;
|
|
1567
1569
|
const sectionIndex = this.parsedConfig.findIndex(
|
|
1568
1570
|
config => config.path === sectionPath
|
|
1569
1571
|
);
|
|
1570
|
-
const [section, subsection] = sectionPath.split('.');
|
|
1571
|
-
const name = path.split('.').pop();
|
|
1572
1572
|
const newConfig = {
|
|
1573
1573
|
section,
|
|
1574
1574
|
subsection,
|
|
@@ -4042,7 +4042,7 @@ class GitIgnoreManager {
|
|
|
4042
4042
|
filepath,
|
|
4043
4043
|
},
|
|
4044
4044
|
];
|
|
4045
|
-
const pieces = filepath.split('/');
|
|
4045
|
+
const pieces = filepath.split('/').filter(Boolean);
|
|
4046
4046
|
for (let i = 1; i < pieces.length; i++) {
|
|
4047
4047
|
const folder = pieces.slice(0, i).join('/');
|
|
4048
4048
|
const file = pieces.slice(i).join('/');
|
|
@@ -5551,6 +5551,7 @@ const worthWalking = (filepath, root) => {
|
|
|
5551
5551
|
* @param {boolean} [args.noUpdateHead]
|
|
5552
5552
|
* @param {boolean} [args.dryRun]
|
|
5553
5553
|
* @param {boolean} [args.force]
|
|
5554
|
+
* @param {boolean} [args.track]
|
|
5554
5555
|
*
|
|
5555
5556
|
* @returns {Promise<void>} Resolves successfully when filesystem operations are complete
|
|
5556
5557
|
*
|
|
@@ -5568,6 +5569,7 @@ async function _checkout({
|
|
|
5568
5569
|
noUpdateHead,
|
|
5569
5570
|
dryRun,
|
|
5570
5571
|
force,
|
|
5572
|
+
track = true,
|
|
5571
5573
|
}) {
|
|
5572
5574
|
// Get tree oid
|
|
5573
5575
|
let oid;
|
|
@@ -5585,11 +5587,13 @@ async function _checkout({
|
|
|
5585
5587
|
gitdir,
|
|
5586
5588
|
ref: remoteRef,
|
|
5587
5589
|
});
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5590
|
+
if (track) {
|
|
5591
|
+
// Set up remote tracking branch
|
|
5592
|
+
const config = await GitConfigManager.get({ fs, gitdir });
|
|
5593
|
+
await config.set(`branch.${ref}.remote`, remote);
|
|
5594
|
+
await config.set(`branch.${ref}.merge`, `refs/heads/${ref}`);
|
|
5595
|
+
await GitConfigManager.save({ fs, gitdir, config });
|
|
5596
|
+
}
|
|
5593
5597
|
// Create a new branch that points at that same commit
|
|
5594
5598
|
await GitRefManager.writeRef({
|
|
5595
5599
|
fs,
|
|
@@ -6114,6 +6118,7 @@ async function analyze({
|
|
|
6114
6118
|
* @param {boolean} [args.noUpdateHead] - If true, will update the working directory but won't update HEAD. Defaults to `false` when `ref` is provided, and `true` if `ref` is not provided.
|
|
6115
6119
|
* @param {boolean} [args.dryRun = false] - If true, simulates a checkout so you can test whether it would succeed.
|
|
6116
6120
|
* @param {boolean} [args.force = false] - If true, conflicts will be ignored and files will be overwritten regardless of local changes.
|
|
6121
|
+
* @param {boolean} [args.track = true] - If false, will not set the remote branch tracking information. Defaults to true.
|
|
6117
6122
|
* @param {object} [args.cache] - a [cache](cache.md) object
|
|
6118
6123
|
*
|
|
6119
6124
|
* @returns {Promise<void>} Resolves successfully when filesystem operations are complete
|
|
@@ -6161,6 +6166,7 @@ async function checkout({
|
|
|
6161
6166
|
noUpdateHead = _ref === undefined,
|
|
6162
6167
|
dryRun = false,
|
|
6163
6168
|
force = false,
|
|
6169
|
+
track = true,
|
|
6164
6170
|
cache = {},
|
|
6165
6171
|
}) {
|
|
6166
6172
|
try {
|
|
@@ -6182,6 +6188,7 @@ async function checkout({
|
|
|
6182
6188
|
noUpdateHead,
|
|
6183
6189
|
dryRun,
|
|
6184
6190
|
force,
|
|
6191
|
+
track,
|
|
6185
6192
|
})
|
|
6186
6193
|
} catch (err) {
|
|
6187
6194
|
err.caller = 'git.checkout';
|
|
@@ -6865,8 +6872,8 @@ function filterCapabilities(server, client) {
|
|
|
6865
6872
|
|
|
6866
6873
|
const pkg = {
|
|
6867
6874
|
name: 'isomorphic-git',
|
|
6868
|
-
version: '1.
|
|
6869
|
-
agent: 'git/isomorphic-git@1.
|
|
6875
|
+
version: '1.11.1',
|
|
6876
|
+
agent: 'git/isomorphic-git@1.11.1',
|
|
6870
6877
|
};
|
|
6871
6878
|
|
|
6872
6879
|
class FIFO {
|
package/index.d.ts
CHANGED
|
@@ -944,6 +944,7 @@ export function branch({ fs, dir, gitdir, ref, checkout, }: {
|
|
|
944
944
|
* @param {boolean} [args.noUpdateHead] - If true, will update the working directory but won't update HEAD. Defaults to `false` when `ref` is provided, and `true` if `ref` is not provided.
|
|
945
945
|
* @param {boolean} [args.dryRun = false] - If true, simulates a checkout so you can test whether it would succeed.
|
|
946
946
|
* @param {boolean} [args.force = false] - If true, conflicts will be ignored and files will be overwritten regardless of local changes.
|
|
947
|
+
* @param {boolean} [args.track = true] - If false, will not set the remote branch tracking information. Defaults to true.
|
|
947
948
|
* @param {object} [args.cache] - a [cache](cache.md) object
|
|
948
949
|
*
|
|
949
950
|
* @returns {Promise<void>} Resolves successfully when filesystem operations are complete
|
|
@@ -979,7 +980,7 @@ export function branch({ fs, dir, gitdir, ref, checkout, }: {
|
|
|
979
980
|
* })
|
|
980
981
|
* console.log('done')
|
|
981
982
|
*/
|
|
982
|
-
export function checkout({ fs, onProgress, dir, gitdir, remote, ref: _ref, filepaths, noCheckout, noUpdateHead, dryRun, force, cache, }: {
|
|
983
|
+
export function checkout({ fs, onProgress, dir, gitdir, remote, ref: _ref, filepaths, noCheckout, noUpdateHead, dryRun, force, track, cache, }: {
|
|
983
984
|
fs: CallbackFsClient | PromiseFsClient;
|
|
984
985
|
onProgress?: ProgressCallback;
|
|
985
986
|
dir: string;
|
|
@@ -991,6 +992,7 @@ export function checkout({ fs, onProgress, dir, gitdir, remote, ref: _ref, filep
|
|
|
991
992
|
noUpdateHead?: boolean;
|
|
992
993
|
dryRun?: boolean;
|
|
993
994
|
force?: boolean;
|
|
995
|
+
track?: boolean;
|
|
994
996
|
cache?: any;
|
|
995
997
|
}): Promise<void>;
|
|
996
998
|
/**
|
package/index.js
CHANGED
|
@@ -1553,16 +1553,16 @@ class GitConfig {
|
|
|
1553
1553
|
this.parsedConfig[configIndex] = modifiedConfig;
|
|
1554
1554
|
}
|
|
1555
1555
|
} else {
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
.toLowerCase()
|
|
1556
|
+
const pathSegments = path.split('.');
|
|
1557
|
+
const section = pathSegments.shift().toLowerCase();
|
|
1558
|
+
const name = pathSegments.pop();
|
|
1559
|
+
const subsection = pathSegments.length
|
|
1560
|
+
? pathSegments.join('.').toLowerCase()
|
|
1561
|
+
: undefined;
|
|
1562
|
+
const sectionPath = subsection ? section + '.' + subsection : section;
|
|
1561
1563
|
const sectionIndex = this.parsedConfig.findIndex(
|
|
1562
1564
|
config => config.path === sectionPath
|
|
1563
1565
|
);
|
|
1564
|
-
const [section, subsection] = sectionPath.split('.');
|
|
1565
|
-
const name = path.split('.').pop();
|
|
1566
1566
|
const newConfig = {
|
|
1567
1567
|
section,
|
|
1568
1568
|
subsection,
|
|
@@ -4036,7 +4036,7 @@ class GitIgnoreManager {
|
|
|
4036
4036
|
filepath,
|
|
4037
4037
|
},
|
|
4038
4038
|
];
|
|
4039
|
-
const pieces = filepath.split('/');
|
|
4039
|
+
const pieces = filepath.split('/').filter(Boolean);
|
|
4040
4040
|
for (let i = 1; i < pieces.length; i++) {
|
|
4041
4041
|
const folder = pieces.slice(0, i).join('/');
|
|
4042
4042
|
const file = pieces.slice(i).join('/');
|
|
@@ -5545,6 +5545,7 @@ const worthWalking = (filepath, root) => {
|
|
|
5545
5545
|
* @param {boolean} [args.noUpdateHead]
|
|
5546
5546
|
* @param {boolean} [args.dryRun]
|
|
5547
5547
|
* @param {boolean} [args.force]
|
|
5548
|
+
* @param {boolean} [args.track]
|
|
5548
5549
|
*
|
|
5549
5550
|
* @returns {Promise<void>} Resolves successfully when filesystem operations are complete
|
|
5550
5551
|
*
|
|
@@ -5562,6 +5563,7 @@ async function _checkout({
|
|
|
5562
5563
|
noUpdateHead,
|
|
5563
5564
|
dryRun,
|
|
5564
5565
|
force,
|
|
5566
|
+
track = true,
|
|
5565
5567
|
}) {
|
|
5566
5568
|
// Get tree oid
|
|
5567
5569
|
let oid;
|
|
@@ -5579,11 +5581,13 @@ async function _checkout({
|
|
|
5579
5581
|
gitdir,
|
|
5580
5582
|
ref: remoteRef,
|
|
5581
5583
|
});
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5584
|
+
if (track) {
|
|
5585
|
+
// Set up remote tracking branch
|
|
5586
|
+
const config = await GitConfigManager.get({ fs, gitdir });
|
|
5587
|
+
await config.set(`branch.${ref}.remote`, remote);
|
|
5588
|
+
await config.set(`branch.${ref}.merge`, `refs/heads/${ref}`);
|
|
5589
|
+
await GitConfigManager.save({ fs, gitdir, config });
|
|
5590
|
+
}
|
|
5587
5591
|
// Create a new branch that points at that same commit
|
|
5588
5592
|
await GitRefManager.writeRef({
|
|
5589
5593
|
fs,
|
|
@@ -6108,6 +6112,7 @@ async function analyze({
|
|
|
6108
6112
|
* @param {boolean} [args.noUpdateHead] - If true, will update the working directory but won't update HEAD. Defaults to `false` when `ref` is provided, and `true` if `ref` is not provided.
|
|
6109
6113
|
* @param {boolean} [args.dryRun = false] - If true, simulates a checkout so you can test whether it would succeed.
|
|
6110
6114
|
* @param {boolean} [args.force = false] - If true, conflicts will be ignored and files will be overwritten regardless of local changes.
|
|
6115
|
+
* @param {boolean} [args.track = true] - If false, will not set the remote branch tracking information. Defaults to true.
|
|
6111
6116
|
* @param {object} [args.cache] - a [cache](cache.md) object
|
|
6112
6117
|
*
|
|
6113
6118
|
* @returns {Promise<void>} Resolves successfully when filesystem operations are complete
|
|
@@ -6155,6 +6160,7 @@ async function checkout({
|
|
|
6155
6160
|
noUpdateHead = _ref === undefined,
|
|
6156
6161
|
dryRun = false,
|
|
6157
6162
|
force = false,
|
|
6163
|
+
track = true,
|
|
6158
6164
|
cache = {},
|
|
6159
6165
|
}) {
|
|
6160
6166
|
try {
|
|
@@ -6176,6 +6182,7 @@ async function checkout({
|
|
|
6176
6182
|
noUpdateHead,
|
|
6177
6183
|
dryRun,
|
|
6178
6184
|
force,
|
|
6185
|
+
track,
|
|
6179
6186
|
})
|
|
6180
6187
|
} catch (err) {
|
|
6181
6188
|
err.caller = 'git.checkout';
|
|
@@ -6859,8 +6866,8 @@ function filterCapabilities(server, client) {
|
|
|
6859
6866
|
|
|
6860
6867
|
const pkg = {
|
|
6861
6868
|
name: 'isomorphic-git',
|
|
6862
|
-
version: '1.
|
|
6863
|
-
agent: 'git/isomorphic-git@1.
|
|
6869
|
+
version: '1.11.1',
|
|
6870
|
+
agent: 'git/isomorphic-git@1.11.1',
|
|
6864
6871
|
};
|
|
6865
6872
|
|
|
6866
6873
|
class FIFO {
|
package/index.umd.min.d.ts
CHANGED
|
@@ -944,6 +944,7 @@ export function branch({ fs, dir, gitdir, ref, checkout, }: {
|
|
|
944
944
|
* @param {boolean} [args.noUpdateHead] - If true, will update the working directory but won't update HEAD. Defaults to `false` when `ref` is provided, and `true` if `ref` is not provided.
|
|
945
945
|
* @param {boolean} [args.dryRun = false] - If true, simulates a checkout so you can test whether it would succeed.
|
|
946
946
|
* @param {boolean} [args.force = false] - If true, conflicts will be ignored and files will be overwritten regardless of local changes.
|
|
947
|
+
* @param {boolean} [args.track = true] - If false, will not set the remote branch tracking information. Defaults to true.
|
|
947
948
|
* @param {object} [args.cache] - a [cache](cache.md) object
|
|
948
949
|
*
|
|
949
950
|
* @returns {Promise<void>} Resolves successfully when filesystem operations are complete
|
|
@@ -979,7 +980,7 @@ export function branch({ fs, dir, gitdir, ref, checkout, }: {
|
|
|
979
980
|
* })
|
|
980
981
|
* console.log('done')
|
|
981
982
|
*/
|
|
982
|
-
export function checkout({ fs, onProgress, dir, gitdir, remote, ref: _ref, filepaths, noCheckout, noUpdateHead, dryRun, force, cache, }: {
|
|
983
|
+
export function checkout({ fs, onProgress, dir, gitdir, remote, ref: _ref, filepaths, noCheckout, noUpdateHead, dryRun, force, track, cache, }: {
|
|
983
984
|
fs: CallbackFsClient | PromiseFsClient;
|
|
984
985
|
onProgress?: ProgressCallback;
|
|
985
986
|
dir: string;
|
|
@@ -991,6 +992,7 @@ export function checkout({ fs, onProgress, dir, gitdir, remote, ref: _ref, filep
|
|
|
991
992
|
noUpdateHead?: boolean;
|
|
992
993
|
dryRun?: boolean;
|
|
993
994
|
force?: boolean;
|
|
995
|
+
track?: boolean;
|
|
994
996
|
cache?: any;
|
|
995
997
|
}): Promise<void>;
|
|
996
998
|
/**
|