isomorphic-git 1.25.6 → 1.25.7
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 -0
- package/browser-tests.json +2 -2
- package/index.cjs +57 -27
- package/index.d.ts +2 -0
- package/index.js +57 -27
- package/index.umd.min.d.ts +2 -0
- package/index.umd.min.js +2 -2
- package/index.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/size_report.html +1 -1
package/README.md
CHANGED
|
@@ -368,6 +368,7 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds
|
|
|
368
368
|
<td align="center"><a href="https://api.github.com/users/hisco"><img src="https://avatars.githubusercontent.com/u/39222286?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Eyal Hisco</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/issues?q=author%3Ahisco" title="Bug reports">🐛</a></td>
|
|
369
369
|
<td align="center"><a href="https://github.com/scolladon"><img src="https://avatars.githubusercontent.com/u/522422?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Sebastien</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=scolladon" title="Code">💻</a></td>
|
|
370
370
|
<td align="center"><a href="https://github.com/yarikoptic"><img src="https://avatars.githubusercontent.com/u/39889?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Yaroslav Halchenko</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=yarikoptic" title="Documentation">📖</a></td>
|
|
371
|
+
<td align="center"><a href="https://alex-v.blog/"><img src="https://avatars.githubusercontent.com/u/716334?v=4?s=60" width="60px;" alt=""/><br /><sub><b>Alex Villarreal</b></sub></a><br /><a href="https://github.com/isomorphic-git/isomorphic-git/commits?author=alexvy86" title="Code">💻</a></td>
|
|
371
372
|
</tr>
|
|
372
373
|
</table>
|
|
373
374
|
|
package/browser-tests.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
[
|
|
2
2
|
"Chrome Headless 79.0.3945.0 (Linux x86_64)",
|
|
3
|
-
"Firefox
|
|
3
|
+
"Firefox 124.0 (Ubuntu 0.0.0)",
|
|
4
4
|
"Chrome 120.0.0.0 (Android 10)",
|
|
5
|
-
"Mobile Safari 13.0 (iOS 13.0)",
|
|
6
5
|
"Edge 79.0.309.65 (Windows 10)",
|
|
6
|
+
"Mobile Safari 13.0 (iOS 13.0)",
|
|
7
7
|
"Safari 13.1 (Mac OS 10.15.4)"
|
|
8
8
|
]
|
package/index.cjs
CHANGED
|
@@ -1796,6 +1796,13 @@ const refpaths = ref => [
|
|
|
1796
1796
|
// @see https://git-scm.com/docs/gitrepository-layout
|
|
1797
1797
|
const GIT_FILES = ['config', 'description', 'index', 'shallow', 'commondir'];
|
|
1798
1798
|
|
|
1799
|
+
let lock$1;
|
|
1800
|
+
|
|
1801
|
+
async function acquireLock(ref, callback) {
|
|
1802
|
+
if (lock$1 === undefined) lock$1 = new AsyncLock();
|
|
1803
|
+
return lock$1.acquire(ref, callback)
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1799
1806
|
class GitRefManager {
|
|
1800
1807
|
static async updateRemoteRefs({
|
|
1801
1808
|
fs,
|
|
@@ -1902,7 +1909,9 @@ class GitRefManager {
|
|
|
1902
1909
|
// are .git/refs/remotes/origin/refs/remotes/remote_mirror_3059
|
|
1903
1910
|
// and .git/refs/remotes/origin/refs/merge-requests
|
|
1904
1911
|
for (const [key, value] of actualRefsToWrite) {
|
|
1905
|
-
await
|
|
1912
|
+
await acquireLock(key, async () =>
|
|
1913
|
+
fs.write(join(gitdir, key), `${value.trim()}\n`, 'utf8')
|
|
1914
|
+
);
|
|
1906
1915
|
}
|
|
1907
1916
|
return { pruned }
|
|
1908
1917
|
}
|
|
@@ -1913,11 +1922,15 @@ class GitRefManager {
|
|
|
1913
1922
|
if (!value.match(/[0-9a-f]{40}/)) {
|
|
1914
1923
|
throw new InvalidOidError(value)
|
|
1915
1924
|
}
|
|
1916
|
-
await
|
|
1925
|
+
await acquireLock(ref, async () =>
|
|
1926
|
+
fs.write(join(gitdir, ref), `${value.trim()}\n`, 'utf8')
|
|
1927
|
+
);
|
|
1917
1928
|
}
|
|
1918
1929
|
|
|
1919
1930
|
static async writeSymbolicRef({ fs, gitdir, ref, value }) {
|
|
1920
|
-
await
|
|
1931
|
+
await acquireLock(ref, async () =>
|
|
1932
|
+
fs.write(join(gitdir, ref), 'ref: ' + `${value.trim()}\n`, 'utf8')
|
|
1933
|
+
);
|
|
1921
1934
|
}
|
|
1922
1935
|
|
|
1923
1936
|
static async deleteRef({ fs, gitdir, ref }) {
|
|
@@ -1928,7 +1941,9 @@ class GitRefManager {
|
|
|
1928
1941
|
// Delete regular ref
|
|
1929
1942
|
await Promise.all(refs.map(ref => fs.rm(join(gitdir, ref))));
|
|
1930
1943
|
// Delete any packed ref
|
|
1931
|
-
let text = await
|
|
1944
|
+
let text = await acquireLock('packed-refs', async () =>
|
|
1945
|
+
fs.read(`${gitdir}/packed-refs`, { encoding: 'utf8' })
|
|
1946
|
+
);
|
|
1932
1947
|
const packed = GitPackedRefs.from(text);
|
|
1933
1948
|
const beforeSize = packed.refs.size;
|
|
1934
1949
|
for (const ref of refs) {
|
|
@@ -1938,7 +1953,9 @@ class GitRefManager {
|
|
|
1938
1953
|
}
|
|
1939
1954
|
if (packed.refs.size < beforeSize) {
|
|
1940
1955
|
text = packed.toString();
|
|
1941
|
-
await
|
|
1956
|
+
await acquireLock('packed-refs', async () =>
|
|
1957
|
+
fs.write(`${gitdir}/packed-refs`, text, { encoding: 'utf8' })
|
|
1958
|
+
);
|
|
1942
1959
|
}
|
|
1943
1960
|
}
|
|
1944
1961
|
|
|
@@ -1957,7 +1974,7 @@ class GitRefManager {
|
|
|
1957
1974
|
return ref
|
|
1958
1975
|
}
|
|
1959
1976
|
}
|
|
1960
|
-
|
|
1977
|
+
|
|
1961
1978
|
// Is it a ref pointer?
|
|
1962
1979
|
if (ref.startsWith('ref: ')) {
|
|
1963
1980
|
ref = ref.slice('ref: '.length);
|
|
@@ -1973,9 +1990,12 @@ class GitRefManager {
|
|
|
1973
1990
|
const allpaths = refpaths(ref).filter(p => !GIT_FILES.includes(p)); // exclude git system files (#709)
|
|
1974
1991
|
|
|
1975
1992
|
for (const ref of allpaths) {
|
|
1976
|
-
sha =
|
|
1977
|
-
|
|
1978
|
-
|
|
1993
|
+
const sha = await acquireLock(
|
|
1994
|
+
ref,
|
|
1995
|
+
async () =>
|
|
1996
|
+
(await fs.read(`${gitdir}/${ref}`, { encoding: 'utf8' })) ||
|
|
1997
|
+
packedMap.get(ref)
|
|
1998
|
+
);
|
|
1979
1999
|
if (sha) {
|
|
1980
2000
|
return GitRefManager.resolve({ fs, gitdir, ref: sha.trim(), depth })
|
|
1981
2001
|
}
|
|
@@ -2003,7 +2023,10 @@ class GitRefManager {
|
|
|
2003
2023
|
// Look in all the proper paths, in this order
|
|
2004
2024
|
const allpaths = refpaths(ref);
|
|
2005
2025
|
for (const ref of allpaths) {
|
|
2006
|
-
|
|
2026
|
+
const refExists = await acquireLock(ref, async () =>
|
|
2027
|
+
fs.exists(`${gitdir}/${ref}`)
|
|
2028
|
+
);
|
|
2029
|
+
if (refExists) return ref
|
|
2007
2030
|
if (packedMap.has(ref)) return ref
|
|
2008
2031
|
}
|
|
2009
2032
|
// Do we give up?
|
|
@@ -2054,7 +2077,9 @@ class GitRefManager {
|
|
|
2054
2077
|
}
|
|
2055
2078
|
|
|
2056
2079
|
static async packedRefs({ fs, gitdir }) {
|
|
2057
|
-
const text = await
|
|
2080
|
+
const text = await acquireLock('packed-refs', async () =>
|
|
2081
|
+
fs.read(`${gitdir}/packed-refs`, { encoding: 'utf8' })
|
|
2082
|
+
);
|
|
2058
2083
|
const packed = GitPackedRefs.from(text);
|
|
2059
2084
|
return packed.refs
|
|
2060
2085
|
}
|
|
@@ -6929,14 +6954,17 @@ async function parseRefsAdResponse(stream, { service }) {
|
|
|
6929
6954
|
|
|
6930
6955
|
const [firstRef, capabilitiesLine] = splitAndAssert(lineTwo, '\x00', '\\x00');
|
|
6931
6956
|
capabilitiesLine.split(' ').map(x => capabilities.add(x));
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6957
|
+
// see no-refs in https://git-scm.com/docs/pack-protocol#_reference_discovery (since git 2.41.0)
|
|
6958
|
+
if (firstRef !== '0000000000000000000000000000000000000000 capabilities^{}') {
|
|
6959
|
+
const [ref, name] = splitAndAssert(firstRef, ' ', ' ');
|
|
6960
|
+
refs.set(name, ref);
|
|
6961
|
+
while (true) {
|
|
6962
|
+
const line = await read();
|
|
6963
|
+
if (line === true) break
|
|
6964
|
+
if (line !== null) {
|
|
6965
|
+
const [ref, name] = splitAndAssert(line.toString('utf8'), ' ', ' ');
|
|
6966
|
+
refs.set(name, ref);
|
|
6967
|
+
}
|
|
6940
6968
|
}
|
|
6941
6969
|
}
|
|
6942
6970
|
// Symrefs are thrown into the "capabilities" unfortunately.
|
|
@@ -7216,14 +7244,14 @@ class GitRemoteManager {
|
|
|
7216
7244
|
}
|
|
7217
7245
|
}
|
|
7218
7246
|
|
|
7219
|
-
let lock$
|
|
7247
|
+
let lock$2 = null;
|
|
7220
7248
|
|
|
7221
7249
|
class GitShallowManager {
|
|
7222
7250
|
static async read({ fs, gitdir }) {
|
|
7223
|
-
if (lock$
|
|
7251
|
+
if (lock$2 === null) lock$2 = new AsyncLock();
|
|
7224
7252
|
const filepath = join(gitdir, 'shallow');
|
|
7225
7253
|
const oids = new Set();
|
|
7226
|
-
await lock$
|
|
7254
|
+
await lock$2.acquire(filepath, async function() {
|
|
7227
7255
|
const text = await fs.read(filepath, { encoding: 'utf8' });
|
|
7228
7256
|
if (text === null) return oids // no file
|
|
7229
7257
|
if (text.trim() === '') return oids // empty file
|
|
@@ -7236,18 +7264,18 @@ class GitShallowManager {
|
|
|
7236
7264
|
}
|
|
7237
7265
|
|
|
7238
7266
|
static async write({ fs, gitdir, oids }) {
|
|
7239
|
-
if (lock$
|
|
7267
|
+
if (lock$2 === null) lock$2 = new AsyncLock();
|
|
7240
7268
|
const filepath = join(gitdir, 'shallow');
|
|
7241
7269
|
if (oids.size > 0) {
|
|
7242
7270
|
const text = [...oids].join('\n') + '\n';
|
|
7243
|
-
await lock$
|
|
7271
|
+
await lock$2.acquire(filepath, async function() {
|
|
7244
7272
|
await fs.write(filepath, text, {
|
|
7245
7273
|
encoding: 'utf8',
|
|
7246
7274
|
});
|
|
7247
7275
|
});
|
|
7248
7276
|
} else {
|
|
7249
7277
|
// No shallows
|
|
7250
|
-
await lock$
|
|
7278
|
+
await lock$2.acquire(filepath, async function() {
|
|
7251
7279
|
await fs.rm(filepath);
|
|
7252
7280
|
});
|
|
7253
7281
|
}
|
|
@@ -7334,8 +7362,8 @@ function filterCapabilities(server, client) {
|
|
|
7334
7362
|
|
|
7335
7363
|
const pkg = {
|
|
7336
7364
|
name: 'isomorphic-git',
|
|
7337
|
-
version: '1.25.
|
|
7338
|
-
agent: 'git/isomorphic-git@1.25.
|
|
7365
|
+
version: '1.25.7',
|
|
7366
|
+
agent: 'git/isomorphic-git@1.25.7',
|
|
7339
7367
|
};
|
|
7340
7368
|
|
|
7341
7369
|
class FIFO {
|
|
@@ -13887,6 +13915,8 @@ async function getHeadTree({ fs, cache, gitdir }) {
|
|
|
13887
13915
|
* ["g.txt", 1, 2, 3], // modified, staged, with unstaged changes
|
|
13888
13916
|
* ["h.txt", 1, 0, 1], // deleted, unstaged
|
|
13889
13917
|
* ["i.txt", 1, 0, 0], // deleted, staged
|
|
13918
|
+
* ["j.txt", 1, 2, 0], // deleted, staged, with unstaged-modified changes (new file of the same name)
|
|
13919
|
+
* ["k.txt", 1, 1, 0], // deleted, staged, with unstaged changes (new file of the same name)
|
|
13890
13920
|
* ]
|
|
13891
13921
|
* ```
|
|
13892
13922
|
*
|
package/index.d.ts
CHANGED
|
@@ -3094,6 +3094,8 @@ export function status({ fs: _fs, dir, gitdir, filepath, cache, }: {
|
|
|
3094
3094
|
* ["g.txt", 1, 2, 3], // modified, staged, with unstaged changes
|
|
3095
3095
|
* ["h.txt", 1, 0, 1], // deleted, unstaged
|
|
3096
3096
|
* ["i.txt", 1, 0, 0], // deleted, staged
|
|
3097
|
+
* ["j.txt", 1, 2, 0], // deleted, staged, with unstaged-modified changes (new file of the same name)
|
|
3098
|
+
* ["k.txt", 1, 1, 0], // deleted, staged, with unstaged changes (new file of the same name)
|
|
3097
3099
|
* ]
|
|
3098
3100
|
* ```
|
|
3099
3101
|
*
|
package/index.js
CHANGED
|
@@ -1790,6 +1790,13 @@ const refpaths = ref => [
|
|
|
1790
1790
|
// @see https://git-scm.com/docs/gitrepository-layout
|
|
1791
1791
|
const GIT_FILES = ['config', 'description', 'index', 'shallow', 'commondir'];
|
|
1792
1792
|
|
|
1793
|
+
let lock$1;
|
|
1794
|
+
|
|
1795
|
+
async function acquireLock(ref, callback) {
|
|
1796
|
+
if (lock$1 === undefined) lock$1 = new AsyncLock();
|
|
1797
|
+
return lock$1.acquire(ref, callback)
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1793
1800
|
class GitRefManager {
|
|
1794
1801
|
static async updateRemoteRefs({
|
|
1795
1802
|
fs,
|
|
@@ -1896,7 +1903,9 @@ class GitRefManager {
|
|
|
1896
1903
|
// are .git/refs/remotes/origin/refs/remotes/remote_mirror_3059
|
|
1897
1904
|
// and .git/refs/remotes/origin/refs/merge-requests
|
|
1898
1905
|
for (const [key, value] of actualRefsToWrite) {
|
|
1899
|
-
await
|
|
1906
|
+
await acquireLock(key, async () =>
|
|
1907
|
+
fs.write(join(gitdir, key), `${value.trim()}\n`, 'utf8')
|
|
1908
|
+
);
|
|
1900
1909
|
}
|
|
1901
1910
|
return { pruned }
|
|
1902
1911
|
}
|
|
@@ -1907,11 +1916,15 @@ class GitRefManager {
|
|
|
1907
1916
|
if (!value.match(/[0-9a-f]{40}/)) {
|
|
1908
1917
|
throw new InvalidOidError(value)
|
|
1909
1918
|
}
|
|
1910
|
-
await
|
|
1919
|
+
await acquireLock(ref, async () =>
|
|
1920
|
+
fs.write(join(gitdir, ref), `${value.trim()}\n`, 'utf8')
|
|
1921
|
+
);
|
|
1911
1922
|
}
|
|
1912
1923
|
|
|
1913
1924
|
static async writeSymbolicRef({ fs, gitdir, ref, value }) {
|
|
1914
|
-
await
|
|
1925
|
+
await acquireLock(ref, async () =>
|
|
1926
|
+
fs.write(join(gitdir, ref), 'ref: ' + `${value.trim()}\n`, 'utf8')
|
|
1927
|
+
);
|
|
1915
1928
|
}
|
|
1916
1929
|
|
|
1917
1930
|
static async deleteRef({ fs, gitdir, ref }) {
|
|
@@ -1922,7 +1935,9 @@ class GitRefManager {
|
|
|
1922
1935
|
// Delete regular ref
|
|
1923
1936
|
await Promise.all(refs.map(ref => fs.rm(join(gitdir, ref))));
|
|
1924
1937
|
// Delete any packed ref
|
|
1925
|
-
let text = await
|
|
1938
|
+
let text = await acquireLock('packed-refs', async () =>
|
|
1939
|
+
fs.read(`${gitdir}/packed-refs`, { encoding: 'utf8' })
|
|
1940
|
+
);
|
|
1926
1941
|
const packed = GitPackedRefs.from(text);
|
|
1927
1942
|
const beforeSize = packed.refs.size;
|
|
1928
1943
|
for (const ref of refs) {
|
|
@@ -1932,7 +1947,9 @@ class GitRefManager {
|
|
|
1932
1947
|
}
|
|
1933
1948
|
if (packed.refs.size < beforeSize) {
|
|
1934
1949
|
text = packed.toString();
|
|
1935
|
-
await
|
|
1950
|
+
await acquireLock('packed-refs', async () =>
|
|
1951
|
+
fs.write(`${gitdir}/packed-refs`, text, { encoding: 'utf8' })
|
|
1952
|
+
);
|
|
1936
1953
|
}
|
|
1937
1954
|
}
|
|
1938
1955
|
|
|
@@ -1951,7 +1968,7 @@ class GitRefManager {
|
|
|
1951
1968
|
return ref
|
|
1952
1969
|
}
|
|
1953
1970
|
}
|
|
1954
|
-
|
|
1971
|
+
|
|
1955
1972
|
// Is it a ref pointer?
|
|
1956
1973
|
if (ref.startsWith('ref: ')) {
|
|
1957
1974
|
ref = ref.slice('ref: '.length);
|
|
@@ -1967,9 +1984,12 @@ class GitRefManager {
|
|
|
1967
1984
|
const allpaths = refpaths(ref).filter(p => !GIT_FILES.includes(p)); // exclude git system files (#709)
|
|
1968
1985
|
|
|
1969
1986
|
for (const ref of allpaths) {
|
|
1970
|
-
sha =
|
|
1971
|
-
|
|
1972
|
-
|
|
1987
|
+
const sha = await acquireLock(
|
|
1988
|
+
ref,
|
|
1989
|
+
async () =>
|
|
1990
|
+
(await fs.read(`${gitdir}/${ref}`, { encoding: 'utf8' })) ||
|
|
1991
|
+
packedMap.get(ref)
|
|
1992
|
+
);
|
|
1973
1993
|
if (sha) {
|
|
1974
1994
|
return GitRefManager.resolve({ fs, gitdir, ref: sha.trim(), depth })
|
|
1975
1995
|
}
|
|
@@ -1997,7 +2017,10 @@ class GitRefManager {
|
|
|
1997
2017
|
// Look in all the proper paths, in this order
|
|
1998
2018
|
const allpaths = refpaths(ref);
|
|
1999
2019
|
for (const ref of allpaths) {
|
|
2000
|
-
|
|
2020
|
+
const refExists = await acquireLock(ref, async () =>
|
|
2021
|
+
fs.exists(`${gitdir}/${ref}`)
|
|
2022
|
+
);
|
|
2023
|
+
if (refExists) return ref
|
|
2001
2024
|
if (packedMap.has(ref)) return ref
|
|
2002
2025
|
}
|
|
2003
2026
|
// Do we give up?
|
|
@@ -2048,7 +2071,9 @@ class GitRefManager {
|
|
|
2048
2071
|
}
|
|
2049
2072
|
|
|
2050
2073
|
static async packedRefs({ fs, gitdir }) {
|
|
2051
|
-
const text = await
|
|
2074
|
+
const text = await acquireLock('packed-refs', async () =>
|
|
2075
|
+
fs.read(`${gitdir}/packed-refs`, { encoding: 'utf8' })
|
|
2076
|
+
);
|
|
2052
2077
|
const packed = GitPackedRefs.from(text);
|
|
2053
2078
|
return packed.refs
|
|
2054
2079
|
}
|
|
@@ -6923,14 +6948,17 @@ async function parseRefsAdResponse(stream, { service }) {
|
|
|
6923
6948
|
|
|
6924
6949
|
const [firstRef, capabilitiesLine] = splitAndAssert(lineTwo, '\x00', '\\x00');
|
|
6925
6950
|
capabilitiesLine.split(' ').map(x => capabilities.add(x));
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6951
|
+
// see no-refs in https://git-scm.com/docs/pack-protocol#_reference_discovery (since git 2.41.0)
|
|
6952
|
+
if (firstRef !== '0000000000000000000000000000000000000000 capabilities^{}') {
|
|
6953
|
+
const [ref, name] = splitAndAssert(firstRef, ' ', ' ');
|
|
6954
|
+
refs.set(name, ref);
|
|
6955
|
+
while (true) {
|
|
6956
|
+
const line = await read();
|
|
6957
|
+
if (line === true) break
|
|
6958
|
+
if (line !== null) {
|
|
6959
|
+
const [ref, name] = splitAndAssert(line.toString('utf8'), ' ', ' ');
|
|
6960
|
+
refs.set(name, ref);
|
|
6961
|
+
}
|
|
6934
6962
|
}
|
|
6935
6963
|
}
|
|
6936
6964
|
// Symrefs are thrown into the "capabilities" unfortunately.
|
|
@@ -7210,14 +7238,14 @@ class GitRemoteManager {
|
|
|
7210
7238
|
}
|
|
7211
7239
|
}
|
|
7212
7240
|
|
|
7213
|
-
let lock$
|
|
7241
|
+
let lock$2 = null;
|
|
7214
7242
|
|
|
7215
7243
|
class GitShallowManager {
|
|
7216
7244
|
static async read({ fs, gitdir }) {
|
|
7217
|
-
if (lock$
|
|
7245
|
+
if (lock$2 === null) lock$2 = new AsyncLock();
|
|
7218
7246
|
const filepath = join(gitdir, 'shallow');
|
|
7219
7247
|
const oids = new Set();
|
|
7220
|
-
await lock$
|
|
7248
|
+
await lock$2.acquire(filepath, async function() {
|
|
7221
7249
|
const text = await fs.read(filepath, { encoding: 'utf8' });
|
|
7222
7250
|
if (text === null) return oids // no file
|
|
7223
7251
|
if (text.trim() === '') return oids // empty file
|
|
@@ -7230,18 +7258,18 @@ class GitShallowManager {
|
|
|
7230
7258
|
}
|
|
7231
7259
|
|
|
7232
7260
|
static async write({ fs, gitdir, oids }) {
|
|
7233
|
-
if (lock$
|
|
7261
|
+
if (lock$2 === null) lock$2 = new AsyncLock();
|
|
7234
7262
|
const filepath = join(gitdir, 'shallow');
|
|
7235
7263
|
if (oids.size > 0) {
|
|
7236
7264
|
const text = [...oids].join('\n') + '\n';
|
|
7237
|
-
await lock$
|
|
7265
|
+
await lock$2.acquire(filepath, async function() {
|
|
7238
7266
|
await fs.write(filepath, text, {
|
|
7239
7267
|
encoding: 'utf8',
|
|
7240
7268
|
});
|
|
7241
7269
|
});
|
|
7242
7270
|
} else {
|
|
7243
7271
|
// No shallows
|
|
7244
|
-
await lock$
|
|
7272
|
+
await lock$2.acquire(filepath, async function() {
|
|
7245
7273
|
await fs.rm(filepath);
|
|
7246
7274
|
});
|
|
7247
7275
|
}
|
|
@@ -7328,8 +7356,8 @@ function filterCapabilities(server, client) {
|
|
|
7328
7356
|
|
|
7329
7357
|
const pkg = {
|
|
7330
7358
|
name: 'isomorphic-git',
|
|
7331
|
-
version: '1.25.
|
|
7332
|
-
agent: 'git/isomorphic-git@1.25.
|
|
7359
|
+
version: '1.25.7',
|
|
7360
|
+
agent: 'git/isomorphic-git@1.25.7',
|
|
7333
7361
|
};
|
|
7334
7362
|
|
|
7335
7363
|
class FIFO {
|
|
@@ -13881,6 +13909,8 @@ async function getHeadTree({ fs, cache, gitdir }) {
|
|
|
13881
13909
|
* ["g.txt", 1, 2, 3], // modified, staged, with unstaged changes
|
|
13882
13910
|
* ["h.txt", 1, 0, 1], // deleted, unstaged
|
|
13883
13911
|
* ["i.txt", 1, 0, 0], // deleted, staged
|
|
13912
|
+
* ["j.txt", 1, 2, 0], // deleted, staged, with unstaged-modified changes (new file of the same name)
|
|
13913
|
+
* ["k.txt", 1, 1, 0], // deleted, staged, with unstaged changes (new file of the same name)
|
|
13884
13914
|
* ]
|
|
13885
13915
|
* ```
|
|
13886
13916
|
*
|
package/index.umd.min.d.ts
CHANGED
|
@@ -3094,6 +3094,8 @@ export function status({ fs: _fs, dir, gitdir, filepath, cache, }: {
|
|
|
3094
3094
|
* ["g.txt", 1, 2, 3], // modified, staged, with unstaged changes
|
|
3095
3095
|
* ["h.txt", 1, 0, 1], // deleted, unstaged
|
|
3096
3096
|
* ["i.txt", 1, 0, 0], // deleted, staged
|
|
3097
|
+
* ["j.txt", 1, 2, 0], // deleted, staged, with unstaged-modified changes (new file of the same name)
|
|
3098
|
+
* ["k.txt", 1, 1, 0], // deleted, staged, with unstaged changes (new file of the same name)
|
|
3097
3099
|
* ]
|
|
3098
3100
|
* ```
|
|
3099
3101
|
*
|