@optique/git 1.0.0-dev.479 → 1.0.0-dev.483
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/dist/index.cjs +8 -7
- package/dist/index.js +8 -7
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -37,15 +37,16 @@ const logger = (0, __logtape_logtape.getLogger)(["optique", "git"]);
|
|
|
37
37
|
* Write methods are implemented as stubs that return rejected promises,
|
|
38
38
|
* enforcing the read-only contract and preventing accidental writes.
|
|
39
39
|
*/
|
|
40
|
+
const readOnlyFsMethod = () => Promise.reject(/* @__PURE__ */ new Error("gitFs is read-only for write operations."));
|
|
40
41
|
const gitFs = {
|
|
41
42
|
readFile: node_fs_promises.readFile,
|
|
42
|
-
writeFile:
|
|
43
|
-
mkdir:
|
|
44
|
-
rmdir:
|
|
45
|
-
unlink:
|
|
43
|
+
writeFile: readOnlyFsMethod,
|
|
44
|
+
mkdir: readOnlyFsMethod,
|
|
45
|
+
rmdir: readOnlyFsMethod,
|
|
46
|
+
unlink: readOnlyFsMethod,
|
|
46
47
|
readdir: node_fs_promises.readdir,
|
|
47
48
|
readlink: node_fs_promises.readlink,
|
|
48
|
-
symlink:
|
|
49
|
+
symlink: readOnlyFsMethod,
|
|
49
50
|
stat: node_fs_promises.stat,
|
|
50
51
|
lstat: node_fs_promises.lstat
|
|
51
52
|
};
|
|
@@ -369,7 +370,7 @@ function gitCommit(options) {
|
|
|
369
370
|
value: oid
|
|
370
371
|
};
|
|
371
372
|
} catch (e) {
|
|
372
|
-
if (hasErrorCode(e, "AmbiguousShortOidError")) return {
|
|
373
|
+
if (hasErrorCode(e, "AmbiguousShortOidError") || hasErrorCode(e, "AmbiguousError")) return {
|
|
373
374
|
success: false,
|
|
374
375
|
error: __optique_core_message.message`Commit SHA ${(0, __optique_core_message.value)(input)} is ambiguous. Provide more characters to disambiguate.`
|
|
375
376
|
};
|
|
@@ -443,7 +444,7 @@ function gitRef(options) {
|
|
|
443
444
|
value: oid
|
|
444
445
|
};
|
|
445
446
|
} catch (e) {
|
|
446
|
-
if (hasErrorCode(e, "AmbiguousShortOidError")) return {
|
|
447
|
+
if (hasErrorCode(e, "AmbiguousShortOidError") || hasErrorCode(e, "AmbiguousError")) return {
|
|
447
448
|
success: false,
|
|
448
449
|
error: __optique_core_message.message`Reference ${(0, __optique_core_message.value)(input)} is ambiguous. Provide more characters to disambiguate.`
|
|
449
450
|
};
|
package/dist/index.js
CHANGED
|
@@ -15,15 +15,16 @@ const logger = getLogger(["optique", "git"]);
|
|
|
15
15
|
* Write methods are implemented as stubs that return rejected promises,
|
|
16
16
|
* enforcing the read-only contract and preventing accidental writes.
|
|
17
17
|
*/
|
|
18
|
+
const readOnlyFsMethod = () => Promise.reject(/* @__PURE__ */ new Error("gitFs is read-only for write operations."));
|
|
18
19
|
const gitFs = {
|
|
19
20
|
readFile: fs.readFile,
|
|
20
|
-
writeFile:
|
|
21
|
-
mkdir:
|
|
22
|
-
rmdir:
|
|
23
|
-
unlink:
|
|
21
|
+
writeFile: readOnlyFsMethod,
|
|
22
|
+
mkdir: readOnlyFsMethod,
|
|
23
|
+
rmdir: readOnlyFsMethod,
|
|
24
|
+
unlink: readOnlyFsMethod,
|
|
24
25
|
readdir: fs.readdir,
|
|
25
26
|
readlink: fs.readlink,
|
|
26
|
-
symlink:
|
|
27
|
+
symlink: readOnlyFsMethod,
|
|
27
28
|
stat: fs.stat,
|
|
28
29
|
lstat: fs.lstat
|
|
29
30
|
};
|
|
@@ -347,7 +348,7 @@ function gitCommit(options) {
|
|
|
347
348
|
value: oid
|
|
348
349
|
};
|
|
349
350
|
} catch (e) {
|
|
350
|
-
if (hasErrorCode(e, "AmbiguousShortOidError")) return {
|
|
351
|
+
if (hasErrorCode(e, "AmbiguousShortOidError") || hasErrorCode(e, "AmbiguousError")) return {
|
|
351
352
|
success: false,
|
|
352
353
|
error: message`Commit SHA ${value(input)} is ambiguous. Provide more characters to disambiguate.`
|
|
353
354
|
};
|
|
@@ -421,7 +422,7 @@ function gitRef(options) {
|
|
|
421
422
|
value: oid
|
|
422
423
|
};
|
|
423
424
|
} catch (e) {
|
|
424
|
-
if (hasErrorCode(e, "AmbiguousShortOidError")) return {
|
|
425
|
+
if (hasErrorCode(e, "AmbiguousShortOidError") || hasErrorCode(e, "AmbiguousError")) return {
|
|
425
426
|
success: false,
|
|
426
427
|
error: message`Reference ${value(input)} is ambiguous. Provide more characters to disambiguate.`
|
|
427
428
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optique/git",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
3
|
+
"version": "1.0.0-dev.483+8c78671b",
|
|
4
4
|
"description": "Git value parsers for Optique",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CLI",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"@logtape/logtape": "^1.2.2",
|
|
61
61
|
"isomorphic-git": "^1.36.1",
|
|
62
|
-
"@optique/core": "1.0.0-dev.
|
|
62
|
+
"@optique/core": "1.0.0-dev.483+8c78671b"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@types/node": "^20.19.9",
|