@statewalker/vcs-commands 0.10.0 → 0.12.0

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.
Files changed (115) hide show
  1. package/dist/commands/am/am-command.d.ts.map +1 -1
  2. package/dist/commands/archive/archive-command.d.ts +81 -7
  3. package/dist/commands/archive/archive-command.d.ts.map +1 -1
  4. package/dist/commands/archive/archive-entry.d.ts +48 -5
  5. package/dist/commands/archive/archive-entry.d.ts.map +1 -1
  6. package/dist/commands/archive/tar-archive.d.ts +5 -2
  7. package/dist/commands/archive/tar-archive.d.ts.map +1 -1
  8. package/dist/commands/archive/zip-archive.d.ts +9 -2
  9. package/dist/commands/archive/zip-archive.d.ts.map +1 -1
  10. package/dist/commands/attributes-source.d.ts +5 -0
  11. package/dist/commands/attributes-source.d.ts.map +1 -1
  12. package/dist/commands/cat-file/cat-file-command.d.ts +9 -0
  13. package/dist/commands/cat-file/cat-file-command.d.ts.map +1 -1
  14. package/dist/commands/checkout-command.d.ts.map +1 -1
  15. package/dist/commands/clone-command.d.ts +9 -0
  16. package/dist/commands/clone-command.d.ts.map +1 -1
  17. package/dist/commands/default-branch.d.ts +12 -0
  18. package/dist/commands/default-branch.d.ts.map +1 -1
  19. package/dist/commands/diff-command.d.ts.map +1 -1
  20. package/dist/commands/format-rev-command.d.ts +6 -4
  21. package/dist/commands/format-rev-command.d.ts.map +1 -1
  22. package/dist/commands/fsmonitor-ipc.d.ts +30 -0
  23. package/dist/commands/fsmonitor-ipc.d.ts.map +1 -0
  24. package/dist/commands/fsmonitor-refresh.d.ts.map +1 -1
  25. package/dist/commands/http-config.d.ts +4 -2
  26. package/dist/commands/http-config.d.ts.map +1 -1
  27. package/dist/commands/index.d.ts +2 -0
  28. package/dist/commands/index.d.ts.map +1 -1
  29. package/dist/commands/index.js +6 -6
  30. package/dist/commands/log-output.d.ts +6 -0
  31. package/dist/commands/log-output.d.ts.map +1 -1
  32. package/dist/commands/ls-files-command.d.ts.map +1 -1
  33. package/dist/commands/ls-tree-command.d.ts.map +1 -1
  34. package/dist/commands/mv-command.d.ts.map +1 -1
  35. package/dist/commands/pathspec.d.ts.map +1 -1
  36. package/dist/commands/plumbing-shared.d.ts +72 -0
  37. package/dist/commands/plumbing-shared.d.ts.map +1 -0
  38. package/dist/commands/repack-command.d.ts +12 -3
  39. package/dist/commands/repack-command.d.ts.map +1 -1
  40. package/dist/commands/replace-command.d.ts.map +1 -1
  41. package/dist/commands/repo-command.d.ts +28 -6
  42. package/dist/commands/repo-command.d.ts.map +1 -1
  43. package/dist/commands/rerere-command.d.ts +12 -0
  44. package/dist/commands/rerere-command.d.ts.map +1 -1
  45. package/dist/commands/rerere.d.ts +22 -0
  46. package/dist/commands/rerere.d.ts.map +1 -1
  47. package/dist/commands/reset-command.d.ts +19 -2
  48. package/dist/commands/reset-command.d.ts.map +1 -1
  49. package/dist/commands/rev-parse-command.d.ts +3 -7
  50. package/dist/commands/rev-parse-command.d.ts.map +1 -1
  51. package/dist/commands/revision-resolver.d.ts +24 -5
  52. package/dist/commands/revision-resolver.d.ts.map +1 -1
  53. package/dist/commands/signing.d.ts +8 -1
  54. package/dist/commands/signing.d.ts.map +1 -1
  55. package/dist/commands/status-command.d.ts +14 -1
  56. package/dist/commands/status-command.d.ts.map +1 -1
  57. package/dist/commands/submodule-add-command.d.ts +12 -0
  58. package/dist/commands/submodule-add-command.d.ts.map +1 -1
  59. package/dist/commands/submodule-update-command.d.ts +14 -0
  60. package/dist/commands/submodule-update-command.d.ts.map +1 -1
  61. package/dist/commands/tag-command.d.ts.map +1 -1
  62. package/dist/commands/update-index-command.d.ts +21 -0
  63. package/dist/commands/update-index-command.d.ts.map +1 -1
  64. package/dist/{commands-Mlo1dxQN.js → commands-C2E51T1z.js} +942 -293
  65. package/dist/{fsck-CrhVMNIH.js → fsck-BjlxStsM.js} +1 -1
  66. package/dist/git-command.d.ts +14 -6
  67. package/dist/git-command.d.ts.map +1 -1
  68. package/dist/index.js +6 -6
  69. package/dist/{maintenance-run-command-Bw21HEkH.js → maintenance-run-command-G_eWdA8O.js} +48 -17
  70. package/dist/remote-config/remote-config-store.d.ts +4 -1
  71. package/dist/remote-config/remote-config-store.d.ts.map +1 -1
  72. package/dist/{remote-transport-Bu4PGSMD.js → remote-transport-CSgTJ1BH.js} +3 -3
  73. package/dist/results/index.js +1 -1
  74. package/dist/{results-ERo9vELd.js → results-Dg1KHG8y.js} +669 -96
  75. package/dist/transport-command.d.ts.map +1 -1
  76. package/package.json +13 -13
  77. package/src/commands/am/am-command.ts +30 -14
  78. package/src/commands/archive/archive-command.ts +395 -59
  79. package/src/commands/archive/archive-entry.ts +88 -5
  80. package/src/commands/archive/tar-archive.ts +40 -9
  81. package/src/commands/archive/zip-archive.ts +72 -21
  82. package/src/commands/attributes-source.ts +13 -1
  83. package/src/commands/cat-file/cat-file-command.ts +64 -52
  84. package/src/commands/checkout-command.ts +22 -1
  85. package/src/commands/clone-command.ts +41 -2
  86. package/src/commands/default-branch.ts +19 -0
  87. package/src/commands/diff-command.ts +19 -1
  88. package/src/commands/format-rev-command.ts +28 -12
  89. package/src/commands/fsmonitor-ipc.ts +121 -0
  90. package/src/commands/fsmonitor-refresh.ts +7 -2
  91. package/src/commands/http-config.ts +14 -2
  92. package/src/commands/index.ts +2 -0
  93. package/src/commands/log-output.ts +11 -0
  94. package/src/commands/ls-files-command.ts +25 -33
  95. package/src/commands/ls-tree-command.ts +30 -22
  96. package/src/commands/mv-command.ts +37 -6
  97. package/src/commands/pathspec.ts +2 -4
  98. package/src/commands/plumbing-shared.ts +197 -0
  99. package/src/commands/repack-command.ts +44 -11
  100. package/src/commands/replace-command.ts +16 -4
  101. package/src/commands/repo-command.ts +124 -25
  102. package/src/commands/rerere-command.ts +17 -0
  103. package/src/commands/rerere.ts +144 -3
  104. package/src/commands/reset-command.ts +75 -3
  105. package/src/commands/rev-parse-command.ts +14 -28
  106. package/src/commands/revision-resolver.ts +85 -34
  107. package/src/commands/signing.ts +54 -7
  108. package/src/commands/status-command.ts +31 -2
  109. package/src/commands/submodule-add-command.ts +18 -1
  110. package/src/commands/submodule-update-command.ts +18 -1
  111. package/src/commands/tag-command.ts +33 -11
  112. package/src/commands/update-index-command.ts +137 -5
  113. package/src/git-command.ts +60 -19
  114. package/src/remote-config/remote-config-store.ts +11 -3
  115. package/src/transport-command.ts +4 -1
@@ -1,8 +1,9 @@
1
1
  import { AddFailedError, BranchUsedByWorktreeError, EmptyTreeEntryNameError, GitApiError, HookFailedError, IncompatibleOptionsError, InvalidArgumentError, InvalidConfigError, InvalidPathError, MissingArgumentError, NoFilepatternError, NoHeadError, NotACommitError, NotImplementedError, RefNotFoundError, ResetRefusedError, RevisionError, StashApplyFailedError, StoreNotAvailableError, WorktreeError, WorktreesUnsupportedError } from "./errors/index.js";
2
- import { DEFAULT_ABBREV_LENGTH, DEFAULT_BIG_FILE_THRESHOLD, EMPTY_BLOB_ID, EMPTY_TREE_ID, FileMode, InvalidTreeEntryNameError, MINIMUM_ABBREV_LENGTH, ObjectFilterError, TreeEntryCursor, autoAbbrevLength, bloomFilterContains, bloomKey, canonTreeMode, collectCommitBytes, collectTreeBytes, commitFromBytes, compareTreeEntries, countAheadBehind, createMemoryHistory, createReplacedBlobs, createReplacedCommits, createReplacedTags, createReplacedTrees, decodeTreeBytes, findAbbrevLengths, formatPersonIdent, graftFileBaseDir, graftFileReader, hasReplacements, historyWithoutLazyFetch, isSymbolicRef, isValidRefName, isValidWorktreePath, listObjectsWithPrefix, loadObjectReplacements, objectFormatOf, overlayMethods, parseCoreAbbrev, parseGraphCommit, parseObjectFilter, probeBlob, protectHFSDefault, replacementOf } from "@statewalker/vcs-core";
2
+ import { DEFAULT_ABBREV_LENGTH, DEFAULT_BIG_FILE_THRESHOLD, EMPTY_BLOB_ID, EMPTY_TREE_ID, FileMode, InvalidTreeEntryNameError, MINIMUM_ABBREV_LENGTH, ObjectFilterError, TreeEntryCursor, autoAbbrevLength, bloomFilterContains, bloomKey, canonTreeMode, collectCommitBytes, collectTreeBytes, commitFromBytes, compareTreeEntries, countAheadBehind, createMemoryHistory, createReplacedBlobs, createReplacedCommits, createReplacedTags, createReplacedTrees, findAbbrevLengths, formatPersonIdent, graftFileBaseDir, graftFileReader, hasReplacements, historyWithoutLazyFetch, isSymbolicRef, isValidRefName, isValidWorktreePath, listObjectsWithPrefix, loadObjectReplacements, objectFormatOf, overlayMethods, parseCoreAbbrev, parseGraphCommit, parseObjectFilter, probeBlob, protectHFSDefault, replacementOf } from "@statewalker/vcs-core";
3
3
  import { compareGitPaths, decodeGitPath, encodeGitPath, foldAsciiCase, gitCharWidth, gitCharWidthAt, gitStrWidth, parseGitBool, parseGitInt, unquoteGitPath } from "@statewalker/vcs-utils/encoding";
4
4
  import { AttributesResolver, DIR_HIDE_EMPTY_DIRECTORIES, DIR_SHOW_IGNORED_TOO, DIR_SHOW_IGNORED_TOO_MODE_MATCHING, DIR_SHOW_OTHER_DIRECTORIES, DeleteStagingEntry, FsmonitorState, IndexChangedError, IndexPathLookup, MergeStage, UpdateStagingEntry, applyStatUpdate, attributesIndexOf, attributesSourceSetting, basicStatMatches, cacheTreeFullyValid, cacheTreeOfTree, clearSkipWorktreeFromPresentFiles, collectChunks, compareWithWorktree, compareWithWorktreeStat, copyCacheTree, createIndexTree, createUntrackedTree, createWorktreeTree, entryStatOf, excludeFileOid, expandUserPath, findUntrackedFiles, flattenTree, getStageState, getWorktreeEntries, hasTrackedChanges, invalidateCacheTreeAgainstIndex, invalidateCacheTreeForIntentToAdd, invalidateCacheTreePath, invalidateGitignore, invalidateUntrackedPath, isCleanByStat, isIndexUnborn, modeFromWorktree, newUntrackedCache, newUntrackedCacheDir, parseSharedRepository, parseSparseCheckoutPatterns, readCleanContent, readConvertedContent, readTreeAttributesFile, refreshIndexStats, refreshableEntries, resolveAttributesSource, scanIndex, scanUntracked, smudgeContent, statDataOf, statUpdateOf, storeWorktreeFile as storeWorktreeFile$1, unreadableDirectoryWarning, untrackedCacheIdent, untrackedCacheIdentIs, untrackedIndexPredicates, updateCacheTree, walkUntrackedScanHost, wholeSeconds, wildmatch, wildmatchBytes, withWorktreeEntries, worktreeEntryChunks, xdgConfigPath, zeroStatData } from "@statewalker/vcs-working-tree";
5
5
  import { BUILTIN_FUNCNAME_PATTERNS, BUILTIN_FUNCNAME_PATTERNS_2_43, BUILTIN_WORD_REGEXES, BUILTIN_WORD_REGEXES_2_43, ByteSink, OrderedMap, PosixRegexError, RawText, SHA1_OBJECT_FORMAT, SHA256_OBJECT_FORMAT, XDF_IGNORE_WHITESPACE, XDF_IGNORE_WHITESPACE_CHANGE, XDF_WHITESPACE_FLAGS, approxidateCareful, approxidateCareful as approxidateCareful$1, bytesToHex, compilePosixRegex, compressBlockPako, createInflater, createSha1, createSha256, decodeGitBinaryDelta, diffLineCounts, formatHunkHeader, formatRfc2822Date, isNullObjectId, isUrlNormalizeError, localTimezoneOffset, mergeLines, normalizeUrl, nullObjectIdLike, objectFormatByHexLength, parseGitBool as parseGitBool$1, parseGitDate, parseGitInt as parseGitInt$1, startProgress, unifiedDiffHunks, urlMatchedEntries, userdiffFindFunction, userdiffWordRegex, whitespaceFlags, writeHunks, xdiffHunks, xdlHashRecord, xdlIsSpace, xdlRecmatch } from "@statewalker/vcs-utils";
6
+ import { duplexOverPort } from "@statewalker/webrun-rpc";
6
7
  import { joinPath as joinPath$1, sharedRepositoryOf, withSharedPerm } from "@statewalker/vcs-utils/files";
7
8
  import { SHA1_OBJECT_FORMAT as SHA1_OBJECT_FORMAT$1, bytesToHex as bytesToHex$1, sha1Of } from "@statewalker/vcs-utils/hash";
8
9
  import { objectStorageFormatByUri, readProtectedConfig } from "@statewalker/vcs-store-files";
@@ -530,14 +531,17 @@ var RemoteConfigStore = class RemoteConfigStore {
530
531
  /**
531
532
  * Every variable whose canonical key starts with `prefix` (lower case), in the
532
533
  * configuration's order with its text (undefined for a variable without `=`), as git's
533
- * config callbacks see them; undefined when the config cannot list its variables.
534
+ * config callbacks see them, and where each was read (file and line; none for the command
535
+ * line); undefined when the config cannot list its variables.
534
536
  */
535
537
  entriesWithPrefix(prefix) {
536
538
  if (!this.config.listWithOrigin) return void 0;
537
539
  const lower = prefix.toLowerCase();
538
540
  return this.config.listWithOrigin().filter((e) => e.key.startsWith(lower)).map((e) => ({
539
541
  key: e.key,
540
- value: e.text
542
+ value: e.text,
543
+ ...e.file !== void 0 ? { file: e.file } : {},
544
+ ...e.line !== void 0 ? { line: e.line } : {}
541
545
  }));
542
546
  }
543
547
  /**
@@ -976,7 +980,13 @@ function bareAttributesResolver(o) {
976
980
  inTree: async (dir) => {
977
981
  if (!o.indexTree && o.sourceTree === void 0) source ??= (async () => {
978
982
  const setting = attributesSourceSetting(environment?.attrSource, configValue$1(workingCopy, "attr.tree"));
979
- if (!setting) return void 0;
983
+ if (!setting) {
984
+ if (!o.defaultSource) return void 0;
985
+ return resolveAttributesSource({
986
+ name: o.defaultSource,
987
+ fromConfig: true
988
+ }, attributesSourceResolver(o.revisions));
989
+ }
980
990
  return resolveAttributesSource(setting, attributesSourceResolver(o.revisions));
981
991
  })();
982
992
  const found = o.indexTree ? void 0 : await source;
@@ -1616,6 +1626,115 @@ async function countObjects(objects) {
1616
1626
  return count;
1617
1627
  }
1618
1628
  //#endregion
1629
+ //#region src/commands/fsmonitor-ipc.ts
1630
+ /**
1631
+ * git's builtin file system monitor daemon asked over a `MessagePort` (fsmonitor-ipc.c's
1632
+ * `fsmonitor_ipc__send_query` over simple-ipc): the request is the token, the answer the new
1633
+ * token and the changed paths, both sent as pkt-lines ended by a flush packet.
1634
+ *
1635
+ * ```typescript
1636
+ * const port = await environment.openIpcPort({ service: "fsmonitor--daemon", path });
1637
+ * const answer = await queryFsmonitorDaemon(port, "builtin:fake");
1638
+ * // answer: "<token>\0<path>\0<path>\0..." as the daemon wrote it, or undefined on failure
1639
+ * ```
1640
+ *
1641
+ * The protocol code never sees a socket: the port speaks webrun-rpc's stream tier (one
1642
+ * stream per port, bounded both ways), whatever carries it (a Unix socket through
1643
+ * `connectSocketPort` of `@statewalker/vcs-utils-node`, a `MessageChannel`, a worker).
1644
+ */
1645
+ /** git's `LARGE_PACKET_DATA_MAX`: the largest payload of one pkt-line. */
1646
+ const LARGE_PACKET_DATA_MAX = 65516;
1647
+ /** The daemon's socket in the git directory (`fsmonitor_ipc__get_default_path`). */
1648
+ const FSMONITOR_DAEMON_IPC_NAME = "fsmonitor--daemon.ipc";
1649
+ const hex = (n) => n.toString(16).padStart(4, "0");
1650
+ /**
1651
+ * `write_packetized_from_buf_no_flush` then `packet_flush`: `payload` as pkt-lines of at
1652
+ * most {@link LARGE_PACKET_DATA_MAX} bytes (none for an empty payload), then `0000`.
1653
+ */
1654
+ function encodePacketized(payload) {
1655
+ const lines = Math.ceil(payload.byteLength / LARGE_PACKET_DATA_MAX);
1656
+ const out = new Uint8Array(payload.byteLength + lines * 4 + 4);
1657
+ let at = 0;
1658
+ for (let from = 0; from < payload.byteLength; from += LARGE_PACKET_DATA_MAX) {
1659
+ const chunk = payload.subarray(from, from + LARGE_PACKET_DATA_MAX);
1660
+ for (const c of hex(chunk.byteLength + 4)) out[at++] = c.charCodeAt(0);
1661
+ out.set(chunk, at);
1662
+ at += chunk.byteLength;
1663
+ }
1664
+ for (let i = 0; i < 4; i++) out[at++] = 48;
1665
+ return out;
1666
+ }
1667
+ /**
1668
+ * Reads pkt-lines from `chunks` up to the first flush packet (`read_packetized_to_strbuf`):
1669
+ * their payloads joined, or undefined when the stream ends first or a length is malformed.
1670
+ */
1671
+ async function readPacketized(chunks) {
1672
+ let buffer = /* @__PURE__ */ new Uint8Array(0);
1673
+ const parts = [];
1674
+ let size = 0;
1675
+ const fill = async (need) => {
1676
+ while (buffer.byteLength < need) {
1677
+ const next = await chunks.next();
1678
+ if (next.done) return false;
1679
+ const joined = new Uint8Array(buffer.byteLength + next.value.byteLength);
1680
+ joined.set(buffer);
1681
+ joined.set(next.value, buffer.byteLength);
1682
+ buffer = joined;
1683
+ }
1684
+ return true;
1685
+ };
1686
+ for (;;) {
1687
+ if (!await fill(4)) return void 0;
1688
+ let length = 0;
1689
+ for (let i = 0; i < 4; i++) {
1690
+ const digit = Number.parseInt(String.fromCharCode(buffer[i]), 16);
1691
+ if (Number.isNaN(digit)) return void 0;
1692
+ length = length * 16 + digit;
1693
+ }
1694
+ if (length === 0) break;
1695
+ if (length < 4) return void 0;
1696
+ if (!await fill(length)) return void 0;
1697
+ const payload = buffer.slice(4, length);
1698
+ parts.push(payload);
1699
+ size += payload.byteLength;
1700
+ buffer = buffer.subarray(length);
1701
+ }
1702
+ const out = new Uint8Array(size);
1703
+ let at = 0;
1704
+ for (const part of parts) {
1705
+ out.set(part, at);
1706
+ at += part.byteLength;
1707
+ }
1708
+ return out;
1709
+ }
1710
+ /**
1711
+ * Sends `token` to the daemon behind `port` and returns its answer (the new token, a NUL,
1712
+ * then the changed paths, each ended by a NUL); undefined when the exchange fails (the
1713
+ * stream fails or ends before the answer's flush packet), as git's
1714
+ * `ipc_client_send_command_to_connection` fails. The port is closed afterwards.
1715
+ */
1716
+ async function queryFsmonitorDaemon(port, token) {
1717
+ let answered = () => {};
1718
+ const done = new Promise((resolve) => {
1719
+ answered = resolve;
1720
+ });
1721
+ async function* request() {
1722
+ yield encodePacketized(new TextEncoder().encode(token));
1723
+ await done;
1724
+ }
1725
+ const output = duplexOverPort(port)(request());
1726
+ port.start();
1727
+ try {
1728
+ return await readPacketized(output);
1729
+ } catch {
1730
+ return;
1731
+ } finally {
1732
+ answered();
1733
+ await output.return(void 0).catch(() => void 0);
1734
+ port.close();
1735
+ }
1736
+ }
1737
+ //#endregion
1619
1738
  //#region src/commands/fsmonitor-refresh.ts
1620
1739
  /**
1621
1740
  * Asking the file system monitor (`core.fsmonitor`) what changed, as git does on every index
@@ -1672,6 +1791,7 @@ async function refreshFsmonitor(options) {
1672
1791
  if (done && done.owner === options.owner) return done.run;
1673
1792
  }
1674
1793
  const nanotime = options.nanotime ?? (() => BigInt(Date.now()) * 1000000n);
1794
+ const added = !state;
1675
1795
  if (!state) {
1676
1796
  state = new FsmonitorState(String(nanotime()));
1677
1797
  state.useForUntracked = true;
@@ -1687,7 +1807,7 @@ async function refreshFsmonitor(options) {
1687
1807
  run
1688
1808
  });
1689
1809
  state.hasRun = true;
1690
- await refresh(run, mode, options, nanotime);
1810
+ await refresh(run, mode, options, nanotime, added);
1691
1811
  if (run.untrackedPaths.length > 0 && staging.carryUntrackedCache) {
1692
1812
  const cache = staging.getUntrackedCache?.();
1693
1813
  if (cache) {
@@ -1715,7 +1835,7 @@ function cString$1(bytes, at) {
1715
1835
  return out;
1716
1836
  }
1717
1837
  /** `refresh_fsmonitor`. */
1718
- async function refresh(run, mode, options, nanotime) {
1838
+ async function refresh(run, mode, options, nanotime, added) {
1719
1839
  const { state } = run;
1720
1840
  let result;
1721
1841
  let token = "";
@@ -1724,7 +1844,7 @@ async function refresh(run, mode, options, nanotime) {
1724
1844
  if (mode.kind === "ipc") {
1725
1845
  result = await ask(options, {
1726
1846
  mode: "ipc",
1727
- token: state.token
1847
+ token: added ? "builtin:fake" : state.token
1728
1848
  });
1729
1849
  if (result) {
1730
1850
  token = cString$1(result, 0);
@@ -1834,6 +1954,7 @@ function onPath(run, entries, name, ignoreCase) {
1834
1954
  run.state.markInvalid(e);
1835
1955
  count++;
1836
1956
  }
1957
+ if (run.state.markSparseDirectoriesInvalid(prefix)) count++;
1837
1958
  };
1838
1959
  if (name.endsWith("/")) cone(name);
1839
1960
  else {
@@ -5055,6 +5176,20 @@ var UnsupportedObjectStorageError = class extends Error {
5055
5176
  this.lines = [line];
5056
5177
  }
5057
5178
  };
5179
+ /**
5180
+ * The death of an `--object-storage-format` option git master does not know: clone takes a
5181
+ * URI (`files`, `files://<dir>`: `object_storage_format_by_uri`), `submodule add`/`update` a
5182
+ * name (`files` alone: `object_storage_format_by_name`, so `files://objs` is unknown there).
5183
+ * Undefined when git takes the value.
5184
+ *
5185
+ * @example
5186
+ * ```typescript
5187
+ * unknownObjectStorageFormat("files://objs", "name"); // "fatal: unknown object storage format 'files://objs'"
5188
+ * ```
5189
+ */
5190
+ function unknownObjectStorageFormat(value, kind) {
5191
+ return (kind === "name" ? value === "files" : objectStorageFormatByUri(value) !== void 0) ? void 0 : `fatal: unknown object storage format '${value}'`;
5192
+ }
5058
5193
  /** A reinitialization naming another object storage payload: git dies (exit 128). */
5059
5194
  var ReinitializeObjectStorageError = class extends Error {
5060
5195
  name = "ReinitializeObjectStorageError";
@@ -5510,6 +5645,164 @@ async function readMailmapFile(path, environment, worktree) {
5510
5645
  }
5511
5646
  }
5512
5647
  //#endregion
5648
+ //#region src/commands/plumbing-shared.ts
5649
+ /**
5650
+ * Helpers the listing plumbing commands share (`ls-files`, `ls-tree`, `cat-file`, pathspec
5651
+ * parsing), and tree-walk.c's `tree_desc` over a tree's stored bytes: git's readers walk a
5652
+ * tree entry by entry and die on the first one that cannot be decoded, after showing what
5653
+ * came before it.
5654
+ */
5655
+ /** ctype.c's GIT_PATHSPEC_MAGIC characters (and `/`, `^`): those that may start short magic */
5656
+ const SHORT_MAGIC = /* @__PURE__ */ new Set([..."!\"#%&',-;<=>@_`~^/"]);
5657
+ /** object_type of a tree or index mode. */
5658
+ function objectTypeOfMode(mode) {
5659
+ const kind = mode & 61440;
5660
+ if (kind === 16384) return "tree";
5661
+ if (kind === 57344) return "commit";
5662
+ return "blob";
5663
+ }
5664
+ /** The chunks joined (the chunk itself when there is one). */
5665
+ function concatBytes$3(chunks) {
5666
+ if (chunks.length === 1) return chunks[0];
5667
+ let size = 0;
5668
+ for (const c of chunks) size += c.length;
5669
+ const out = new Uint8Array(size);
5670
+ let at = 0;
5671
+ for (const c of chunks) {
5672
+ out.set(c, at);
5673
+ at += c.length;
5674
+ }
5675
+ return out;
5676
+ }
5677
+ /** Everything a byte stream yields, joined. */
5678
+ async function readAllBytes(content) {
5679
+ const chunks = [];
5680
+ for await (const c of content) chunks.push(c);
5681
+ return chunks.length === 0 ? /* @__PURE__ */ new Uint8Array(0) : concatBytes$3(chunks);
5682
+ }
5683
+ /**
5684
+ * git's death on a tree it cannot decode (tree-walk.c's `decode_tree_entry` and
5685
+ * `update_tree_entry`): `fatal: too-short tree object`, `fatal: malformed mode in tree entry`,
5686
+ * `fatal: empty filename in tree entry`, `fatal: too-short tree file`; exit 128.
5687
+ */
5688
+ var CorruptTreeError = class extends GitApiError {
5689
+ reason;
5690
+ treeId;
5691
+ constructor(reason, treeId) {
5692
+ super(`fatal: ${reason}`, { exitCode: 128 });
5693
+ this.reason = reason;
5694
+ this.treeId = treeId;
5695
+ this.name = "CorruptTreeError";
5696
+ }
5697
+ };
5698
+ const SPACE = 32;
5699
+ /**
5700
+ * tree-walk.c's `tree_desc` over a tree's stored bytes, as git's readers (`read_tree_at`,
5701
+ * `ls-tree`, `cat-file -p`) walk it: each entry is yielded only once the one after it was
5702
+ * decoded (`tree_entry` advances before its caller looks at the entry it got), so a walk over
5703
+ * a tree whose third entry is corrupt sees the first and dies with {@link CorruptTreeError}
5704
+ * asking for the second. Names are not checked (git's readers list `..`), modes are
5705
+ * canonical (`canon_mode`).
5706
+ *
5707
+ * @example
5708
+ * ```typescript
5709
+ * for (const entry of walkTreeDesc(raw, 20)) console.log(entry.name);
5710
+ * ```
5711
+ *
5712
+ * @param raw the tree's stored content
5713
+ * @param rawLength the id width of the repository's hash (20 or 32)
5714
+ * @param treeId the tree, carried by the error
5715
+ * @throws CorruptTreeError where git dies
5716
+ */
5717
+ function* walkTreeDesc(raw, rawLength, treeId) {
5718
+ for (const e of treeDesc(raw, rawLength, treeId)) yield {
5719
+ mode: e.mode,
5720
+ name: decodeGitPath(raw.subarray(e.nameStart, e.nameEnd)),
5721
+ id: bytesToHex(raw.subarray(e.nameEnd + 1, e.nameEnd + 1 + rawLength))
5722
+ };
5723
+ }
5724
+ /**
5725
+ * tree-walk.c's `find_tree_entry`: the entry a path (bytes, not empty) names in a tree's
5726
+ * stored bytes, each entry compared with the whole path as git compares it (an entry that
5727
+ * matches a leading part followed by `/` is entered, one sorting after the path ends the
5728
+ * walk), each looked at once the next one decoded (a corrupt entry right after the one
5729
+ * found is still git's death). `rest` is the path left to look up in the subtree `id`
5730
+ * (`get_tree_entry`'s recursion); none when the entry itself was found (`d/` names `d`).
5731
+ *
5732
+ * @example
5733
+ * ```typescript
5734
+ * findTreeDescEntry(raw, 20, encodeGitPath("src/main.ts")); // { id, mode, rest: "main.ts" }
5735
+ * ```
5736
+ *
5737
+ * @throws CorruptTreeError where git dies
5738
+ */
5739
+ function findTreeDescEntry(raw, rawLength, name, treeId) {
5740
+ const namelen = name.length;
5741
+ for (const e of treeDesc(raw, rawLength, treeId)) {
5742
+ const entrylen = e.nameEnd - e.nameStart;
5743
+ if (entrylen > namelen) continue;
5744
+ let cmp = 0;
5745
+ for (let i = 0; i < entrylen && cmp === 0; i++) cmp = name[i] - raw[e.nameStart + i];
5746
+ if (cmp > 0) continue;
5747
+ if (cmp < 0) break;
5748
+ const id = () => bytesToHex(raw.subarray(e.nameEnd + 1, e.nameEnd + 1 + rawLength));
5749
+ if (entrylen === namelen) return {
5750
+ id: id(),
5751
+ mode: e.mode
5752
+ };
5753
+ if (name[entrylen] !== 47) continue;
5754
+ if ((e.mode & 61440) !== 16384) break;
5755
+ if (entrylen + 1 === namelen) return {
5756
+ id: id(),
5757
+ mode: e.mode
5758
+ };
5759
+ return {
5760
+ id: id(),
5761
+ mode: e.mode,
5762
+ rest: name.subarray(entrylen + 1)
5763
+ };
5764
+ }
5765
+ }
5766
+ /** The walk of {@link walkTreeDesc}, entries by position. */
5767
+ function* treeDesc(raw, rawLength, treeId) {
5768
+ const end = raw.length;
5769
+ let at = 0;
5770
+ if (at >= end) return;
5771
+ let current = decodeTreeEntry(raw, at, end, rawLength, treeId);
5772
+ for (;;) {
5773
+ const len = current.nameEnd + 1 - at + rawLength;
5774
+ if (end - at < len) throw new CorruptTreeError("too-short tree file", treeId);
5775
+ at += len;
5776
+ const held = current;
5777
+ if (at >= end) {
5778
+ yield held;
5779
+ return;
5780
+ }
5781
+ current = decodeTreeEntry(raw, at, end, rawLength, treeId);
5782
+ yield held;
5783
+ }
5784
+ }
5785
+ /** decode_tree_entry: the entry at `at`. */
5786
+ function decodeTreeEntry(raw, at, end, rawLength, treeId) {
5787
+ if (end - at < rawLength + 3 || raw[end - (rawLength + 1)] !== 0) throw new CorruptTreeError("too-short tree object", treeId);
5788
+ let i = at;
5789
+ let mode = 0;
5790
+ if (raw[i] === SPACE) throw new CorruptTreeError("malformed mode in tree entry", treeId);
5791
+ for (;;) {
5792
+ const c = raw[i++];
5793
+ if (c === SPACE) break;
5794
+ if (c < 48 || c > 55) throw new CorruptTreeError("malformed mode in tree entry", treeId);
5795
+ mode = mode * 8 + (c - 48);
5796
+ }
5797
+ const nameEnd = raw.indexOf(0, i);
5798
+ if (nameEnd === i) throw new CorruptTreeError("empty filename in tree entry", treeId);
5799
+ return {
5800
+ mode: canonTreeMode(mode),
5801
+ nameStart: i,
5802
+ nameEnd
5803
+ };
5804
+ }
5805
+ //#endregion
5513
5806
  //#region src/commands/http-config.ts
5514
5807
  /**
5515
5808
  * The HTTP client settings git's configuration gives `url` (see the module notes); undefined
@@ -5545,6 +5838,12 @@ function httpClientSettingsOf(config, url, environment, options = {}) {
5545
5838
  case "emptyauth":
5546
5839
  settings.emptyAuth = value === "auto" ? "auto" : bool$1(key, value);
5547
5840
  break;
5841
+ case "proactiveauth":
5842
+ if (options.compatibility === "2.43") break;
5843
+ if (value === void 0) throw missingValue(key);
5844
+ if (value === "auto" || value === "basic" || value === "none") settings.proactiveAuth = value;
5845
+ else options.onWarning?.("warning: Unknown value for http.proactiveauth");
5846
+ break;
5548
5847
  case "followredirects":
5549
5848
  settings.followRedirects = value === "initial" ? "initial" : bool$1(key, value) ? "always" : "none";
5550
5849
  break;
@@ -5888,7 +6187,7 @@ function createPromisorFetcher(workingCopy, options = {}) {
5888
6187
  const history = historyWithoutLazyFetch(workingCopy.history);
5889
6188
  const compatibility = compatibilityOf();
5890
6189
  const run = async () => {
5891
- const { fetchFsckOf } = await import("./fsck-CrhVMNIH.js").then((n) => n.t);
6190
+ const { fetchFsckOf } = await import("./fsck-BjlxStsM.js").then((n) => n.t);
5892
6191
  const environment = hostEnvironmentOf(workingCopy);
5893
6192
  const fsckWarnings = [];
5894
6193
  const unpackLimit = unpackLimitOf({ getAll: (key) => config.values(key) }, "fetch");
@@ -5902,7 +6201,7 @@ function createPromisorFetcher(workingCopy, options = {}) {
5902
6201
  home: environment.home
5903
6202
  } : {}
5904
6203
  });
5905
- const { prepareRemote, protocolVersionOf, withRemoteUploadPack } = await import("./remote-transport-Bu4PGSMD.js").then((n) => n.s);
6204
+ const { prepareRemote, protocolVersionOf, withRemoteUploadPack } = await import("./remote-transport-CSgTJ1BH.js").then((n) => n.s);
5906
6205
  await withRemoteUploadPack(await prepareRemote(workingCopy, url, options.transports ?? createDefaultTransports()), {
5907
6206
  ...options.credentials ? { credentials: options.credentials } : {},
5908
6207
  ...options.headers ? { headers: options.headers } : {},
@@ -11062,6 +11361,11 @@ var RerereRun = class {
11062
11361
  if (!current) return false;
11063
11362
  const result = await this.tryMerge(id, path, current);
11064
11363
  if (!result) return false;
11364
+ await this.writeReplayed(id, path, result);
11365
+ return true;
11366
+ }
11367
+ /** The end of `merge`: a replayed resolution written to the worktree. */
11368
+ async writeReplayed(id, path, result) {
11065
11369
  const postimage = this.path(id, "postimage");
11066
11370
  if (!await this.files.touch?.(postimage)) {
11067
11371
  const bytes = await this.readFile(postimage);
@@ -11072,7 +11376,6 @@ var RerereRun = class {
11072
11376
  raw: true,
11073
11377
  ...entry && !entry.isDirectory ? { mode: entry.mode } : {}
11074
11378
  });
11075
- return true;
11076
11379
  }
11077
11380
  /** `remove_variant`. */
11078
11381
  async removeVariant(id) {
@@ -11465,6 +11768,7 @@ async function handleCache(run, path, stages, output) {
11465
11768
  if (output) await run.writeFile(output, parsed.output);
11466
11769
  return {
11467
11770
  status: parsed.status,
11771
+ output: parsed.output,
11468
11772
  ...parsed.id ? { id: parsed.id } : {}
11469
11773
  };
11470
11774
  }
@@ -11519,6 +11823,126 @@ async function rerereGcLocation(workingCopy) {
11519
11823
  gitDir: location.path.replace(/\/?rr-cache$/, "") || "."
11520
11824
  };
11521
11825
  }
11826
+ /** `check_one_conflict`'s three-staged conflict: no stage 0, ours and theirs regular files. */
11827
+ function threeStaged(stages) {
11828
+ if (stages.length === 0 || stages.some((s) => s.stage === 0)) return false;
11829
+ const isRegular = (mode) => mode !== void 0 && (mode & 61440) === 32768;
11830
+ return isRegular(stages.find((s) => s.stage === 2)?.mode) && isRegular(stages.find((s) => s.stage === 3)?.mode);
11831
+ }
11832
+ async function stagesOf(staging, path) {
11833
+ return (await staging.getEntries(path)).map((e) => ({
11834
+ stage: e.stage,
11835
+ mode: e.mode,
11836
+ objectId: e.objectId
11837
+ }));
11838
+ }
11839
+ /**
11840
+ * rerere for a resolution store (`ResolutionStore` of vcs-store-files): its records are
11841
+ * git's, written by rerere.c's steps only.
11842
+ *
11843
+ * `record(path)` is what two `git rerere` runs record for a path, one while it was
11844
+ * conflicted and one once resolved: the variant `MERGE_RR` names for the path; else the
11845
+ * preimage recreated from the stages as `rerere forget` recreates it (`handle_cache`),
11846
+ * nothing recorded when a recorded variant replays cleanly onto it (git's first run would
11847
+ * have replayed it; its id is returned), else a new variant (`assign_variant`); then the
11848
+ * worktree file as the postimage (`copy_file`: an existing one stays) and the path dropped
11849
+ * from `MERGE_RR`.
11850
+ * `replay(path)` is `do_rerere_one_path`'s replay over the conflicted worktree file.
11851
+ * Nothing is written where rerere is off (`setup_rerere`).
11852
+ *
11853
+ * @example
11854
+ * ```typescript
11855
+ * const engine = rerereEngineOf(rerereHostOf(workingCopy, staging, worktree, blobs, format));
11856
+ * await engine.record("f"); // "<conflict id>"
11857
+ * ```
11858
+ */
11859
+ function rerereEngineOf(host) {
11860
+ return {
11861
+ record: (path) => recordOnePath(host, path),
11862
+ replay: (path, options) => replayOnePath(host, path, options?.apply === true)
11863
+ };
11864
+ }
11865
+ async function recordOnePath(host, path) {
11866
+ const run = await setupRerere(host);
11867
+ if (!run) return void 0;
11868
+ if ((await run.handleFile(path, false)).status !== 0) return void 0;
11869
+ const rr = await run.readRr();
11870
+ const waiting = rr.get(path);
11871
+ let id;
11872
+ if (waiting && waiting.variant >= 0) id = waiting;
11873
+ else {
11874
+ const stages = await stagesOf(host.staging, path);
11875
+ if (!threeStaged(stages)) return void 0;
11876
+ const { status, id: hex, output } = await handleCache(run, path, stages);
11877
+ if (status < 1 || !hex || !output) return void 0;
11878
+ id = await run.newId(hex);
11879
+ for (let variant = 0; variant < id.dir.status.length; variant++) {
11880
+ if (((id.dir.status[variant] ?? 0) & BOTH) !== BOTH) continue;
11881
+ if (await run.tryMerge({
11882
+ dir: id.dir,
11883
+ variant
11884
+ }, path, output)) return hex;
11885
+ }
11886
+ run.assignVariant(id);
11887
+ await run.mkdir(run.path(id));
11888
+ if (!((id.dir.status[id.variant] ?? 0) & RR_HAS_PREIMAGE)) await run.writeFile(run.path(id, "preimage"), output);
11889
+ }
11890
+ fit(id.dir, id.variant);
11891
+ const bits = id.dir.status[id.variant] ?? 0;
11892
+ const postimage = run.path(id, "postimage");
11893
+ if (await run.files.stats(postimage) === void 0) {
11894
+ const content = await run.readWorktree(path);
11895
+ if (!content) return void 0;
11896
+ await run.mkdir(run.path(id));
11897
+ await run.writeFile(postimage, content);
11898
+ }
11899
+ id.dir.status[id.variant] = bits | 3;
11900
+ if (rr.has(path)) {
11901
+ rr.delete(path);
11902
+ await run.writeRr(rr);
11903
+ }
11904
+ return id.dir.hex;
11905
+ }
11906
+ async function replayOnePath(host, path, apply) {
11907
+ const run = await setupRerere(host);
11908
+ if (!run) return void 0;
11909
+ if (!threeStaged(await stagesOf(host.staging, path))) return void 0;
11910
+ const content = await run.readWorktree(path);
11911
+ if (!content) return void 0;
11912
+ const parsed = normalizeConflicts(content, await run.markerSize(path), host.objectFormat);
11913
+ if (parsed.status < 1 || !parsed.id) return void 0;
11914
+ const dir = await run.dir(parsed.id);
11915
+ for (let variant = 0; variant < dir.status.length; variant++) {
11916
+ if (((dir.status[variant] ?? 0) & BOTH) !== BOTH) continue;
11917
+ const id = {
11918
+ dir,
11919
+ variant
11920
+ };
11921
+ if (apply) await run.writeFile(run.path(id, "thisimage"), parsed.output);
11922
+ const merged = await run.tryMerge(id, path, parsed.output);
11923
+ if (!merged) continue;
11924
+ const preimage = await run.readFile(run.path(id, "preimage"));
11925
+ const postimage = await run.readFile(run.path(id, "postimage"));
11926
+ if (!preimage || !postimage) continue;
11927
+ if (apply) {
11928
+ await run.writeReplayed(id, path, merged);
11929
+ const rr = await run.readRr();
11930
+ const waiting = rr.get(path);
11931
+ if (waiting !== void 0) {
11932
+ if (waiting && waiting.dir === dir && waiting.variant >= 0 && waiting.variant !== variant) await run.removeVariant(waiting);
11933
+ rr.delete(path);
11934
+ await run.writeRr(rr);
11935
+ }
11936
+ }
11937
+ return {
11938
+ signature: dir.hex,
11939
+ variant,
11940
+ preimage,
11941
+ postimage,
11942
+ content: merged
11943
+ };
11944
+ }
11945
+ }
11522
11946
  //#endregion
11523
11947
  //#region src/commands/revision-range.ts
11524
11948
  /** dir.c's has_glob_specials */
@@ -12478,6 +12902,13 @@ var RevisionResolver = class {
12478
12902
  lastMode;
12479
12903
  config;
12480
12904
  disambiguateChecked = false;
12905
+ /**
12906
+ * Whether an abbreviation missed: git's get_short_oid then runs `odb_reprepare`, which
12907
+ * flushes the loose object cache the map had put the compatibility ids into, and nothing
12908
+ * puts them back, so the rest of the process finds no compatibility id by `GET_OID_HASH_ANY`
12909
+ * (git master: `echo <miss> <compat id> | git cat-file --batch-check` reports both missing)
12910
+ */
12911
+ compatIdsFlushed = false;
12481
12912
  /** Refs read while resolving one revision (`HEAD~3` reads HEAD once) */
12482
12913
  refCache = /* @__PURE__ */ new Map();
12483
12914
  constructor(sources, now = () => Math.floor(Date.now() / 1e3)) {
@@ -13009,6 +13440,8 @@ var RevisionResolver = class {
13009
13440
  }
13010
13441
  /** The type of an object, undefined when the repository does not have it. */
13011
13442
  async objectType(id) {
13443
+ const compat = this.sources.objects?.compat;
13444
+ if (compat && id.length !== this.hexLength && id.length === compat.compat.hexLength) return (await safe(() => compat.readAsCompat(id)))?.type;
13012
13445
  const { commits, tags, trees, blobs } = this.sources;
13013
13446
  if (await safe(() => commits.has(id))) return "commit";
13014
13447
  if (tags && await safe(() => tags.has(id))) return "tag";
@@ -13080,38 +13513,46 @@ var RevisionResolver = class {
13080
13513
  }
13081
13514
  }
13082
13515
  /**
13083
- * git's `get_tree_entry` / `find_tree_entry`: the object at `path` in a tree (the tree
13084
- * itself for ""). Components are matched exactly: an empty one (`/a`, `d//b`) names
13085
- * nothing, and a trailing `/` only follows a directory (`d/` is d, `a.txt/` nothing).
13516
+ * git's `get_tree_entry`: the object at `path` in a tree (the tree itself for ""), found
13517
+ * as `find_tree_entry` walks the tree's stored bytes (names unchecked, so an entry named
13518
+ * `..` is found; a corrupt tree git's death, {@link CorruptTreeError}). A store without
13519
+ * stored bytes answers from its decoded entries, component by component.
13086
13520
  */
13087
- async findTreeEntry(tree, name) {
13521
+ async treeEntry(tree, path) {
13522
+ if (path === "") return tree;
13088
13523
  const trees = this.sources.trees;
13089
- try {
13090
- return await trees.getEntry(tree, name);
13091
- } catch (e) {
13092
- if (e?.name !== "InvalidTreeEntryNameError" || !trees.raw) return void 0;
13093
- const raw = await safe(() => trees.raw?.(tree) ?? Promise.resolve(void 0));
13524
+ if (!trees.raw) return this.treeEntryDecoded(tree, path);
13525
+ const rawLength = objectFormatOf(this.sources.objects).rawLength;
13526
+ let current = tree;
13527
+ let rest = encodeGitPath(path);
13528
+ for (;;) {
13529
+ const id = current;
13530
+ const raw = await safe(() => trees.raw?.(id) ?? Promise.resolve(void 0));
13094
13531
  if (!raw) return void 0;
13095
- const found = decodeTreeBytes(raw, {
13096
- canonicalModes: true,
13097
- idLength: objectFormatOf(this.sources.objects).rawLength,
13098
- checkNames: false
13099
- }).find((e) => e.name === name);
13100
- return found ? {
13101
- id: found.id,
13102
- mode: found.mode
13103
- } : void 0;
13532
+ const found = findTreeDescEntry(raw, rawLength, rest, current);
13533
+ if (!found) return void 0;
13534
+ if (!found.rest) {
13535
+ this.lastMode = found.mode;
13536
+ return found.id;
13537
+ }
13538
+ current = found.id;
13539
+ rest = found.rest;
13104
13540
  }
13105
13541
  }
13106
- async treeEntry(tree, path) {
13107
- if (path === "") return tree;
13542
+ /**
13543
+ * {@link treeEntry} over a store's decoded entries: components matched exactly, an empty
13544
+ * one (`/a`, `d//b`) names nothing, a trailing `/` only follows a directory.
13545
+ */
13546
+ async treeEntryDecoded(tree, path) {
13547
+ const trees = this.sources.trees;
13108
13548
  let current = tree;
13109
13549
  let rest = path;
13110
13550
  for (;;) {
13111
13551
  const slash = rest.indexOf("/");
13112
13552
  const name = slash < 0 ? rest : rest.slice(0, slash);
13113
13553
  if (name === "") return void 0;
13114
- const entry = await this.findTreeEntry(current, name);
13554
+ const at = current;
13555
+ const entry = await safe(() => trees.getEntry(at, name));
13115
13556
  if (!entry) return void 0;
13116
13557
  if (slash < 0) {
13117
13558
  this.lastMode = entry.mode;
@@ -13233,10 +13674,20 @@ var RevisionResolver = class {
13233
13674
  * when it accepts several.
13234
13675
  */
13235
13676
  async shortOid(name, flags = {}) {
13236
- if (name.length < MINIMUM_ABBREV_LENGTH || name.length > this.hexLength || !HEX_DIGITS.test(name)) return { status: "invalid" };
13677
+ const compat = flags.hashAny && !this.compatIdsFlushed ? this.sources.objects?.compat : void 0;
13678
+ const maxLength = Math.max(this.hexLength, compat?.compat.hexLength ?? 0);
13679
+ if (name.length < MINIMUM_ABBREV_LENGTH || name.length > maxLength || !HEX_DIGITS.test(name)) return { status: "invalid" };
13237
13680
  const prefix = name.toLowerCase();
13238
- const candidates = await this.objectsWithPrefix(prefix);
13239
- if (candidates.length === 0) return { status: "missing" };
13681
+ const candidates = name.length <= this.hexLength ? await this.objectsWithPrefix(prefix) : [];
13682
+ if (compat && name.length <= compat.compat.hexLength) {
13683
+ const ids = await compat.compatIdsWithPrefix(prefix);
13684
+ for (const id of ids) if (!candidates.includes(id)) candidates.push(id);
13685
+ candidates.sort();
13686
+ }
13687
+ if (candidates.length === 0) {
13688
+ if (this.sources.objects?.compat) this.compatIdsFlushed = true;
13689
+ return { status: "missing" };
13690
+ }
13240
13691
  const hint = flags.hint ?? this.defaultHint();
13241
13692
  let status;
13242
13693
  let listedHint = hint;
@@ -13268,10 +13719,10 @@ var RevisionResolver = class {
13268
13719
  type: await this.objectType(id)
13269
13720
  });
13270
13721
  const rank = (t) => t === "tag" ? 0 : t === "commit" ? 1 : t === "tree" ? 2 : t === "blob" ? 3 : -1;
13271
- typed.sort((a, b) => rank(a.type) !== rank(b.type) ? rank(a.type) - rank(b.type) : a.id < b.id ? -1 : 1);
13722
+ typed.sort((a, b) => rank(a.type) !== rank(b.type) ? rank(a.type) - rank(b.type) : a.id.length !== b.id.length ? a.id.length - b.id.length : a.id < b.id ? -1 : 1);
13272
13723
  const shown = [];
13273
13724
  for (const c of typed) if (hint === void 0 || await this.satisfies(c.id, hint)) shown.push(c);
13274
- const lengths = await safe(async () => this.sources.abbreviate?.(shown.map((c) => c.id))) ?? void 0;
13725
+ const lengths = await safe(async () => this.sources.abbreviate?.(shown.filter((c) => c.id.length === this.hexLength).map((c) => c.id))) ?? void 0;
13275
13726
  const lines = [`error: short object ID ${prefix} is ambiguous`, "hint: The candidates are:"];
13276
13727
  for (const { id, type } of shown) {
13277
13728
  const hash = id.slice(0, lengths?.get(id) ?? 7);
@@ -13824,15 +14275,49 @@ async function signPayload(workingCopy, sign, payload, options) {
13824
14275
  */
13825
14276
  async function signCommit(workingCopy, sign, commit, options = {}) {
13826
14277
  if (sign === void 0) return commit;
13827
- const { gpgSignature: _dropped, ...unsigned } = commit;
14278
+ const { gpgSignature: _dropped, compatSignature: _droppedCompat, ...unsigned } = commit;
13828
14279
  const payload = await collectCommitBytes(unsigned);
13829
- const signature = new TextDecoder().decode(await signPayload(workingCopy, sign, payload, {
14280
+ const signOptions = {
13830
14281
  ...options,
13831
14282
  committer: commit.committer
13832
- }));
13833
- return {
14283
+ };
14284
+ const signature = new TextDecoder().decode(await signPayload(workingCopy, sign, payload, signOptions));
14285
+ const signed = {
13834
14286
  ...unsigned,
13835
- gpgSignature: signature.endsWith("\n") ? signature.slice(0, -1) : signature
14287
+ gpgSignature: headerSignature(signature)
14288
+ };
14289
+ const compat = workingCopy.history.objects?.compat;
14290
+ if (compat) {
14291
+ const compatPayload = await compat.convertToCompat("commit", payload);
14292
+ const compatSignature = new TextDecoder().decode(await signPayload(workingCopy, sign, compatPayload, signOptions));
14293
+ signed.compatSignature = {
14294
+ header: compat.compat.signatureHeader,
14295
+ value: headerSignature(compatSignature)
14296
+ };
14297
+ }
14298
+ return signed;
14299
+ }
14300
+ /**
14301
+ * A signature as a header holds it: its lines without the last newline (add_header_signature
14302
+ * writes each line with its newline).
14303
+ */
14304
+ function headerSignature(signature) {
14305
+ return signature.endsWith("\n") ? signature.slice(0, -1) : signature;
14306
+ }
14307
+ /**
14308
+ * builtin/tag.c `do_sign` in a repository with a compatibility object format: the tag as
14309
+ * that format sees it signed too, its signature to go in the tag's header (the storage
14310
+ * signature ends the message), so the tag's compatibility id covers a signature in its own
14311
+ * format. Undefined without a compatibility format.
14312
+ */
14313
+ async function signTagCompat(workingCopy, sign, payload, options) {
14314
+ const compat = workingCopy.history.objects?.compat;
14315
+ if (!compat) return void 0;
14316
+ const compatPayload = await compat.convertToCompat("tag", payload);
14317
+ const signature = new TextDecoder().decode(await signPayload(workingCopy, sign, compatPayload, options));
14318
+ return {
14319
+ header: compat.compat.signatureHeader,
14320
+ value: headerSignature(signature)
13836
14321
  };
13837
14322
  }
13838
14323
  /** A uint32 length-prefixed string of an ssh wire buffer at `at`. */
@@ -14155,15 +14640,32 @@ var GitCommand = class {
14155
14640
  return refreshFsmonitor({
14156
14641
  staging,
14157
14642
  owner: this,
14158
- config: (key) => config.value(key),
14643
+ config: (key) => key === "core.fsmonitor" && !this.hasWorktree() ? void 0 : config.value(key),
14159
14644
  ignoreCase: parseGitBool$1(config.value("core.ignorecase")) === true,
14160
14645
  query: async (query) => {
14161
14646
  if (environment?.fsmonitor) return environment.fsmonitor.query(query);
14162
- if (query.mode !== "hook" || query.command === void 0) return void 0;
14647
+ if (query.mode === "ipc") {
14648
+ if (!environment?.openIpcPort) return void 0;
14649
+ const gitDir = await this.hooks.hostGitDir({ real: false });
14650
+ if (!gitDir) return void 0;
14651
+ const stdout = await queryFsmonitorDaemon(await environment.openIpcPort({
14652
+ service: "fsmonitor--daemon",
14653
+ path: `${gitDir}/${FSMONITOR_DAEMON_IPC_NAME}`
14654
+ }), query.token);
14655
+ return stdout ? {
14656
+ exitCode: 0,
14657
+ stdout
14658
+ } : void 0;
14659
+ }
14660
+ if (query.command === void 0) return void 0;
14163
14661
  return this.hooks.runShellCommandBytes("fsmonitor", query.command, [String(query.version), query.token]);
14164
14662
  }
14165
14663
  });
14166
14664
  }
14665
+ /** Whether the working copy has a worktree (a bare repository's refuses to give one). */
14666
+ hasWorktree() {
14667
+ return "worktree" in this._workingCopy && !!this._workingCopy.worktree;
14668
+ }
14167
14669
  /**
14168
14670
  * The hooks this command runs (git's `run_hooks_opt`), through the host environment's
14169
14671
  * `hookRunner`; with none, no hook runs.
@@ -14858,8 +15360,10 @@ var GitCommand = class {
14858
15360
  *
14859
15361
  * @param refuseUnwritten false for a command that writes no index (`clean`): unwritten
14860
15362
  * edits are then kept and used instead of refusing
15363
+ *
15364
+ * The file system monitor is then asked (git's `tweak_fsmonitor`, see `fsmonitorRefresh`).
14861
15365
  */
14862
- async readCurrentIndex(refuseUnwritten = true) {
15366
+ async readCurrentIndex(refuseUnwritten = true, fsmonitor = true) {
14863
15367
  const staging = this.staging;
14864
15368
  if (await staging.isOutdated()) {
14865
15369
  if (staging.hasUnwrittenChanges?.() !== false) {
@@ -14869,6 +15373,7 @@ var GitCommand = class {
14869
15373
  await staging.read();
14870
15374
  }
14871
15375
  await this.clearPresentSkipWorktree();
15376
+ if (fsmonitor && !await isIndexUnborn(staging)) await this.fsmonitorRefresh(staging);
14872
15377
  }
14873
15378
  /**
14874
15379
  * git's `clear_skip_worktree_from_present_files`, which `repo_read_index` runs on every
@@ -15205,26 +15710,32 @@ var GitCommand = class {
15205
15710
  return entries;
15206
15711
  }
15207
15712
  /**
15208
- * A tree's entries for a listing (`ls-tree`, `cat-file -p`), as git's readers list them: a
15209
- * tree holding a name fsck refuses (`..`, `a/b`), which the store will not decode, is read
15210
- * from its stored bytes without the name check. Undefined when the tree cannot be read.
15713
+ * A tree's entries for a listing (`ls-tree`, `cat-file -p`, `ls-files --with-tree`), as
15714
+ * git's readers walk them (tree-walk.c's `tree_desc`, {@link walkTreeDesc}): from the stored
15715
+ * bytes, names not checked (a tree holding `..` lists), each entry yielded once the next one
15716
+ * decoded, a corrupt entry git's death ({@link CorruptTreeError}) when the walk reaches it.
15717
+ * Undefined when the tree cannot be read (missing, or not a tree).
15211
15718
  */
15212
15719
  async listedTreeEntries(id) {
15720
+ const compat = this.compatObjects;
15721
+ if (compat && id.length !== this.objectFormat.hexLength) {
15722
+ const tree = await compat.readAsCompat(id).catch(() => void 0);
15723
+ if (tree?.type !== "tree") return void 0;
15724
+ return walkTreeDesc(tree.content, compat.compat.rawLength, id);
15725
+ }
15726
+ const trees = this.trees;
15727
+ if (trees.raw) {
15728
+ const raw = await trees.raw(id).catch(() => void 0);
15729
+ return raw ? walkTreeDesc(raw, this.objectFormat.rawLength, id) : void 0;
15730
+ }
15213
15731
  try {
15214
- const loaded = await this.trees.load(id);
15732
+ const loaded = await trees.load(id);
15215
15733
  if (!loaded) return void 0;
15216
15734
  const entries = [];
15217
15735
  for await (const e of loaded) entries.push(e);
15218
15736
  return entries;
15219
- } catch (e) {
15220
- if (e?.name !== "InvalidTreeEntryNameError") return void 0;
15221
- const raw = await this.trees.raw?.(id).catch(() => void 0);
15222
- if (!raw) return void 0;
15223
- return decodeTreeBytes(raw, {
15224
- canonicalModes: true,
15225
- idLength: this.objectFormat.rawLength,
15226
- checkNames: false
15227
- });
15737
+ } catch {
15738
+ return;
15228
15739
  }
15229
15740
  }
15230
15741
  /** The commits of `.git/shallow` (none in a complete repository). */
@@ -24337,8 +24848,6 @@ function unescapeAttrValue(value) {
24337
24848
  }
24338
24849
  return out;
24339
24850
  }
24340
- /** git's characters that may introduce short pathspec magic (`GIT_PATHSPEC_MAGIC`). */
24341
- const SHORT_MAGIC_CHARS = /* @__PURE__ */ new Set([..."!\"#%&',-;<=>@_`~^/"]);
24342
24851
  /**
24343
24852
  * The pathspec elements as git's `parse_pathspec` reads them from the top of the worktree:
24344
24853
  * short magic (`:/` top, `:!` and `:^` exclude) and long magic (`:(top,literal,glob,icase,
@@ -24409,7 +24918,7 @@ function parsePathspecItem(elem, options = {}) {
24409
24918
  for (; pos < elem.length && elem[pos] !== ":"; pos++) {
24410
24919
  const ch = elem[pos];
24411
24920
  if (ch === "!" || ch === "^") exclude = true;
24412
- else if (ch === "/") {} else if (!SHORT_MAGIC_CHARS.has(ch)) break;
24921
+ else if (ch === "/") {} else if (!SHORT_MAGIC.has(ch)) break;
24413
24922
  else throw new Error(`Unimplemented pathspec magic '${ch}' in '${elem}'`);
24414
24923
  }
24415
24924
  if (elem[pos] === ":") pos++;
@@ -26349,6 +26858,10 @@ var LogPrinter = class {
26349
26858
  this.verboseHeader = !options.diffTree || prettyGiven;
26350
26859
  const pretty = options.oneline ? "oneline" : options.pretty ?? host.config("format.pretty");
26351
26860
  this.format = parseCommitFormat(pretty, host);
26861
+ if (options.prettyOnly) this.format = {
26862
+ ...this.format,
26863
+ expandTabs: 0
26864
+ };
26352
26865
  const dateSpec = options.date ?? host.config("log.date");
26353
26866
  this.dateMode = dateSpec ? parseDateMode(dateSpec) : this.format.dateShort ? {
26354
26867
  type: "short",
@@ -26700,6 +27213,10 @@ var LogPrinter = class {
26700
27213
  log.pending = false;
26701
27214
  const { fmt } = this.format;
26702
27215
  if (this.options.noCommitId) return;
27216
+ if (this.options.prettyOnly) {
27217
+ this.out.text(await this.prettyPrint(entry, ""));
27218
+ return;
27219
+ }
26703
27220
  if (!this.verboseHeader) {
26704
27221
  if (this.graph) this.out.text(this.graph.showCommit());
26705
27222
  else {
@@ -35627,7 +36144,7 @@ var SubmoduleUnpack = class SubmoduleUnpack {
35627
36144
  }
35628
36145
  async m() {
35629
36146
  if (this.loadedMover) return this.loadedMover;
35630
- this.moverLoad ??= import("./commands-Mlo1dxQN.js").then((n) => n.Hn).then((commands) => {
36147
+ this.moverLoad ??= import("./commands-C2E51T1z.js").then((n) => n.Hn).then((commands) => {
35631
36148
  this.commands = commands;
35632
36149
  this.loadedMover = new commands.SubmoduleHeadMover(this.workingCopy, this.superPrefix);
35633
36150
  return this.loadedMover;
@@ -36080,9 +36597,11 @@ var ResetCommand = class extends GitCommand {
36080
36597
  staging: this.staging
36081
36598
  }) : void 0;
36082
36599
  let flagged;
36600
+ let fsmKept;
36083
36601
  if (this.mode === "hard") {
36084
36602
  const commit = await this.commits.load(targetId);
36085
36603
  if (commit) {
36604
+ if (this.worktreeAccess) fsmKept = await fsmonitorKeptEntries(this.trees, this.staging, commit.tree);
36086
36605
  flagged = await checkFlaggedEntries({
36087
36606
  trees: this.trees,
36088
36607
  staging: this.staging,
@@ -36108,14 +36627,14 @@ var ResetCommand = class extends GitCommand {
36108
36627
  this.warnings.push(...await moveHeadAsReset(this.refsStore, state, headId, targetId, this.reflogLine(message), `${this.hasReflogAction() ? this.reflogAction("reset") : "reset"}: updating ORIG_HEAD`));
36109
36628
  if (this.mode === "mixed" || this.mode === "hard") {
36110
36629
  markIndexUpdate(this.staging, this.mode === "hard" ? { workdir: true } : { skipWorktree: true });
36111
- await this.resetStaging(targetId);
36630
+ await this.resetStaging(targetId, fsmKept);
36112
36631
  }
36113
36632
  if (this.mode === "mixed" && await this.refreshAfterReset()) await this.staging.write();
36114
36633
  if (this.mode === "hard") {
36115
36634
  const written = await this.resetWorkingTree(targetId, trackedBefore ?? /* @__PURE__ */ new Set(), flagged?.keptOut, sparse, submodules && {
36116
36635
  unpack: submodules,
36117
36636
  oldIndex
36118
- });
36637
+ }, fsmKept && new Set(fsmKept.keys()));
36119
36638
  if (this.worktreeAccess && written.size > 0) {
36120
36639
  await recordWrittenStat(this.staging, this.worktreeAccess, written);
36121
36640
  await this.staging.write();
@@ -36345,7 +36864,7 @@ var ResetCommand = class extends GitCommand {
36345
36864
  * @param targetId Commit to reset the working tree to
36346
36865
  * @param trackedBefore Paths tracked before staging was reset
36347
36866
  */
36348
- async resetWorkingTree(targetId, trackedBefore, keptOut, sparse, submodules) {
36867
+ async resetWorkingTree(targetId, trackedBefore, keptOut, sparse, submodules, unchanged) {
36349
36868
  const worktree = this.worktreeAccess;
36350
36869
  if (!worktree) return /* @__PURE__ */ new Set();
36351
36870
  const commit = await this.commits.load(targetId);
@@ -36355,16 +36874,17 @@ var ResetCommand = class extends GitCommand {
36355
36874
  blobs: this.blobs,
36356
36875
  workingCopy: this.workingCopy,
36357
36876
  worktree
36358
- }, commit.tree, trackedBefore, keptOut, sparse, submodules);
36877
+ }, commit.tree, trackedBefore, keptOut, sparse, submodules, unchanged);
36359
36878
  }
36360
36879
  /**
36361
36880
  * Reset staging area to match a tree.
36362
36881
  */
36363
- async resetStaging(commitId) {
36882
+ async resetStaging(commitId, kept) {
36364
36883
  const commit = await this.commits.load(commitId);
36365
36884
  if (commit) {
36366
36885
  if (this.mode !== "mixed") {
36367
36886
  await this.staging.readTree(this.trees, commit.tree, { keepMatching: "flags" });
36887
+ if (kept) await restoreKeptEntries(this.staging, kept);
36368
36888
  await this.primeCacheTree(commit.tree);
36369
36889
  await this.staging.write();
36370
36890
  return;
@@ -36435,7 +36955,7 @@ var ResetCommand = class extends GitCommand {
36435
36955
  * patterns are written, nothing that stays outside is removed, and the files leaving the
36436
36956
  * checkout are unlinked first. Returns the paths written.
36437
36957
  */
36438
- async function restoreWorktreeHard(deps, treeId, trackedBefore, keptOut, sparse, submodules) {
36958
+ async function restoreWorktreeHard(deps, treeId, trackedBefore, keptOut, sparse, submodules, unchanged) {
36439
36959
  const { trees, blobs, workingCopy, worktree } = deps;
36440
36960
  const subs = submodules?.unpack;
36441
36961
  const oldGitlink = (path) => {
@@ -36448,7 +36968,8 @@ async function restoreWorktreeHard(deps, treeId, trackedBefore, keptOut, sparse,
36448
36968
  ...worktreePathRules(workingCopy, worktree),
36449
36969
  reservedNames: worktree.capabilities?.reservedNames
36450
36970
  });
36451
- const skip = sparse ? (path) => !sparse.writes(path) : keptOut && keptOut.size > 0 ? (path) => keptOut.has(path) : void 0;
36971
+ const outside = sparse ? (path) => !sparse.writes(path) : keptOut && keptOut.size > 0 ? (path) => keptOut.has(path) : void 0;
36972
+ const skip = unchanged && unchanged.size > 0 ? (path) => unchanged.has(path) || !!outside?.(path) : outside;
36452
36973
  const plan = skip ? {
36453
36974
  ...fullPlan,
36454
36975
  entries: fullPlan.entries.filter((e) => !skip(e.path)),
@@ -36513,6 +37034,42 @@ async function recordWrittenStat(staging, worktree, paths) {
36513
37034
  if (edits > 0) await editor.finish();
36514
37035
  }
36515
37036
  /**
37037
+ * unpack-trees' `oneway_merge` under a reset (`reset --hard`, `checkout -f`): a stage-0 entry
37038
+ * the target keeps unchanged and the file system monitor holds valid (`CE_FSMONITOR_VALID`)
37039
+ * is neither lstat'ed nor written, and stays in the index as it is, bit and stat included.
37040
+ * Only an entry the monitor was asked about in this command, and reported nothing for, is
37041
+ * held valid (`FsmonitorState.isValid`: exactly as marked); gitlinks and skip-worktree
37042
+ * entries never are here. The entries by path, empty when the monitor is off.
37043
+ */
37044
+ async function fsmonitorKeptEntries(trees, staging, treeId) {
37045
+ const kept = /* @__PURE__ */ new Map();
37046
+ const state = staging.getFsmonitor?.();
37047
+ if (!state?.hasRun) return kept;
37048
+ let target;
37049
+ for await (const entry of staging.entries()) {
37050
+ if (entry.stage !== 0 || entry.mode === FileMode.GITLINK) continue;
37051
+ if (entry.skipWorktree || entry.intentToAdd || !state.isValid(entry)) continue;
37052
+ target ??= await flatTree(trees, treeId);
37053
+ const t = target.get(entry.path);
37054
+ if (t && t.mode === entry.mode && t.objectId === entry.objectId) kept.set(entry.path, entry);
37055
+ }
37056
+ return kept;
37057
+ }
37058
+ /**
37059
+ * After a one-way reset read the target into the index: the entries `oneway_merge` kept
37060
+ * (`fsmonitorKeptEntries`) put back exactly as they were (`add_entry` of the old entry), so
37061
+ * their stat and fsmonitor bit survive. Not written here.
37062
+ */
37063
+ async function restoreKeptEntries(staging, kept) {
37064
+ if (kept.size === 0) return;
37065
+ const editor = staging.createEditor();
37066
+ for (const old of kept.values()) editor.add({
37067
+ path: old.path,
37068
+ apply: (existing) => existing && existing.stage === 0 && existing.mode === old.mode && existing.objectId === old.objectId ? old : existing
37069
+ });
37070
+ await editor.finish();
37071
+ }
37072
+ /**
36516
37073
  * The index entries whose flags cheat (assume-unchanged, skip-worktree) before a one-way
36517
37074
  * reset onto `treeId` (`reset --hard`, `checkout -f`): unpack-trees checks them even when it
36518
37075
  * resets (`verify_uptodate_1`: "CE_VALID and CE_SKIP_WORKTREE cheat"), so one the tree
@@ -40039,16 +40596,9 @@ var RevParseCommand = class extends GitCommand {
40039
40596
  if (await this.tryParentShorthands(resolver, arg, lines)) continue;
40040
40597
  const reversed = arg.startsWith("^");
40041
40598
  let id;
40042
- if (output !== void 0) {
40043
- const translated = await this.translatedRevision(reversed ? arg.slice(1) : arg, output);
40044
- if (translated !== void 0) {
40045
- lines.push(reversed ? `^${translated}` : translated);
40046
- continue;
40047
- }
40048
- }
40049
40599
  try {
40050
- id = await resolver.resolve(reversed ? arg.slice(1) : arg);
40051
- if (id !== void 0 && output === "compat") id = await this.outputCompat(id);
40600
+ id = await resolver.resolve(reversed ? arg.slice(1) : arg, output !== void 0 ? { hashAny: true } : {});
40601
+ if (id !== void 0 && output !== void 0) id = await this.outputId(id, output);
40052
40602
  } catch (error) {
40053
40603
  if (error instanceof RevisionError && resolver.warnings.length > 0) throw new RevisionError(arg, [...resolver.warnings, error.message].join("\n"));
40054
40604
  throw error;
@@ -40070,21 +40620,15 @@ var RevParseCommand = class extends GitCommand {
40070
40620
  };
40071
40621
  }
40072
40622
  /**
40073
- * A full id of the compatibility format under `--output-object-format` (git's
40074
- * `GET_OID_HASH_ANY`): printed as given in that format, else as the storage id the map
40075
- * gives (as given when it has none, as git's ignored `repo_oid_to_algop` failure leaves it).
40076
- * Undefined for anything else.
40623
+ * `repo_oid_to_algop`: `id` (of either format) printed in the format asked, through the map;
40624
+ * as it is when the map has no translation (git ignores that failure).
40077
40625
  */
40078
- async translatedRevision(name, output) {
40626
+ async outputId(id, output) {
40079
40627
  const compat = this.compatObjects;
40080
- if (!compat || name.length !== compat.compat.hexLength || !/^[0-9a-fA-F]+$/.test(name)) return;
40081
- const id = name.toLowerCase();
40082
- if (output === "compat") return id;
40083
- return await compat.toStorage(id) ?? id;
40084
- }
40085
- /** `id` in the compatibility format, as the map gives it (else as it is, as git) */
40086
- async outputCompat(id) {
40087
- return await this.compatObjects?.toCompat(id) ?? id;
40628
+ if (!compat) return id;
40629
+ const isStorage = id.length === this.objectFormat.hexLength;
40630
+ if (output === "storage") return isStorage ? id : await compat.toStorage(id) ?? id;
40631
+ return isStorage ? await compat.toCompat(id) ?? id : id;
40088
40632
  }
40089
40633
  /**
40090
40634
  * git's `try_difference`: `a..b` prints b and ^a; `a...b` prints b, a and ^ each merge base.
@@ -41576,16 +42120,34 @@ async function concat(chunks) {
41576
42120
  return out;
41577
42121
  }
41578
42122
  /**
42123
+ * The warning lines for a submodule we cannot look into (git opens it, we do not), or
42124
+ * undefined for any other failure, which stays fatal as git's child status dies on it.
42125
+ */
42126
+ function submoduleNotSupportedWarning(path, error) {
42127
+ if (!(error instanceof Error) || error.name !== "UnsupportedRepositoryFormatError") return;
42128
+ if (!error.notSupportedHere) return;
42129
+ return [`warning: cannot look into submodule '${path}': ${error.message}`];
42130
+ }
42131
+ /**
41579
42132
  * The state of the submodule at `path` in its own index and worktree, as git's
41580
42133
  * `is_submodule_modified` reads it from `git status --porcelain=2` run inside it: an
41581
42134
  * untracked file there (or a nested submodule holding only untracked files, `S..U`) is
41582
42135
  * untracked content; any other change, a nested submodule's included, is modified content.
41583
42136
  * Nothing for a submodule that is not populated (or that the worktree cannot open). A
41584
42137
  * configuration the inner status cannot read fails with its messages and git's
41585
- * `'git status --porcelain=2' failed in submodule <path>`.
42138
+ * `'git status --porcelain=2' failed in submodule <path>`. A repository git opens and we do
42139
+ * not (an `extensions.objectStorage` payload, statewalker/webrun-vcs#441) is no failure of
42140
+ * the superproject: its state is `unreadable`, with a warning.
41586
42141
  */
41587
42142
  async function readSubmoduleDirt(worktree, path, ignoreUntracked) {
41588
- const inner = await worktree.openGitlink?.(path);
42143
+ let inner;
42144
+ try {
42145
+ inner = await worktree.openGitlink?.(path);
42146
+ } catch (error) {
42147
+ const unreadable = submoduleNotSupportedWarning(path, error);
42148
+ if (unreadable) return { unreadable };
42149
+ throw error;
42150
+ }
41589
42151
  if (!inner) return {};
41590
42152
  const command = new StatusCommand(inner).setRenames(false);
41591
42153
  if (ignoreUntracked) command.setUntrackedFiles("no");
@@ -42115,6 +42677,7 @@ var StatusCommand = class extends GitCommand {
42115
42677
  const indexTime = this.staging.getUpdateTime();
42116
42678
  const gitlinks = /* @__PURE__ */ new Set();
42117
42679
  const refresh = [];
42680
+ const submoduleWarnings = [];
42118
42681
  const unmerged = /* @__PURE__ */ new Map();
42119
42682
  const upToDate = /* @__PURE__ */ new Set();
42120
42683
  const matchAll = this.paths.length === 0;
@@ -42206,7 +42769,10 @@ var StatusCommand = class extends GitCommand {
42206
42769
  if (!result.kind && !replaced && !flags && !entry.intentToAdd) fsm?.state.markValid(entry);
42207
42770
  if (!result.kind && isIgnoreFilePath(entry.path)) upToDate.add(entry.path);
42208
42771
  if (flags && result.kind === "modified") commitChanged = true;
42209
- if (flags && !flags.dirty && result.worktreeEntry?.isDirectory) dirt = await readSubmoduleDirt(worktree, entry.path, flags.untracked);
42772
+ if (flags && !flags.dirty && result.worktreeEntry?.isDirectory) {
42773
+ dirt = await readSubmoduleDirt(worktree, entry.path, flags.untracked);
42774
+ if (dirt.unreadable) submoduleWarnings.push(...dirt.unreadable);
42775
+ }
42210
42776
  if (result.kind === "deleted") {
42211
42777
  y = "D";
42212
42778
  missing.add(entry.path);
@@ -42275,6 +42841,7 @@ var StatusCommand = class extends GitCommand {
42275
42841
  }
42276
42842
  const renamed = /* @__PURE__ */ new Map();
42277
42843
  const warnings = (fsm?.warnings ?? []).map((w) => `warning: ${w}`);
42844
+ warnings.push(...submoduleWarnings);
42278
42845
  const renameMode = this.renameMode();
42279
42846
  if (renameMode) await this.pairRenames(files, renamed, worktree, warnings, renameMode);
42280
42847
  const host = worktree ? await worktree.untrackedScanHost?.() : void 0;
@@ -45537,12 +46104,17 @@ var DiffCommand = class DiffCommand extends GitCommand {
45537
46104
  const trust = worktreeModeTrust(this.workingCopy, worktree);
45538
46105
  const indexTime = this.staging.getUpdateTime();
45539
46106
  const ignoreOf = await this.submoduleIgnoreOf();
46107
+ const fsm = await this.fsmonitorRefresh(this.staging);
46108
+ const fsmValid = (entry) => !!fsm && entry.stage === 0 && fsm.state.isValid(entry);
46109
+ const statsValid = unmergedAsFiles && this.hooks.compatibility === "2.43";
46110
+ const fsmUnstated = (entry) => !statsValid && fsmValid(entry);
45540
46111
  const compareWith = async (entry, current) => {
45541
46112
  const indexSide = {
45542
46113
  mode: entry.mode,
45543
46114
  id: entry.objectId
45544
46115
  };
45545
- if (entry.skipWorktree || entry.assumeValid) return indexSide;
46116
+ if (entry.skipWorktree || entry.assumeValid || fsmUnstated(entry)) return indexSide;
46117
+ if (fsmValid(entry)) return (current !== void 0 ? current : await worktree.getEntry(entry.path).catch(() => null)) ? indexSide : void 0;
45546
46118
  const ignore = entry.mode === GITLINK ? ignoreOf(entry.path) : void 0;
45547
46119
  if (entry.mode === GITLINK && ignore === "all") return indexSide;
45548
46120
  const result = await compareWithWorktree(worktree, entry, {
@@ -45557,6 +46129,7 @@ var DiffCommand = class DiffCommand extends GitCommand {
45557
46129
  const dirt = {};
45558
46130
  if (entry.mode === GITLINK && ignore !== "dirty" && (this.dirtyThisCall || id === entry.objectId) && result.worktreeEntry?.isDirectory) {
45559
46131
  const found = await readSubmoduleDirt(worktree, entry.path, ignore !== "none");
46132
+ for (const line of found.unreadable ?? []) if (!this.configWarnings.includes(line)) this.configWarnings.push(line);
45560
46133
  if (found.modified) dirt.modified = true;
45561
46134
  if (ignore === "none" && found.untracked) dirt.untracked = true;
45562
46135
  dirty = !!dirt.modified || !!dirt.untracked;
@@ -45606,7 +46179,7 @@ var DiffCommand = class DiffCommand extends GitCommand {
45606
46179
  };
45607
46180
  };
45608
46181
  const compare = (entry) => compareWith(entry);
45609
- const stated = (entry) => entry.stage === 0 && !entry.skipWorktree && !entry.assumeValid && entry.mode !== GITLINK && this.matches(entry.path);
46182
+ const stated = (entry) => entry.stage === 0 && !entry.skipWorktree && !entry.assumeValid && entry.mode !== GITLINK && !fsmUnstated(entry) && this.matches(entry.path);
45610
46183
  for await (const { item: entry, current } of withWorktreeEntries(worktree, this.staging.entries(), stated)) {
45611
46184
  if (entry.stage !== 0) {
45612
46185
  let stages = unmerged.get(entry.path);
@@ -49670,4 +50243,4 @@ let RevertStatus = /* @__PURE__ */ function(RevertStatus) {
49670
50243
  return RevertStatus;
49671
50244
  }({});
49672
50245
  //#endregion
49673
- export { RevParseCommand as $, disableHint as $a, checkoutFreshTree as $c, conflictsComment as $i, findIdent as $l, remergeObjectsView as $n, computeDiffstat as $o, latin1Bytes as $r, createPromisorFetcher as $s, ResetMode as $t, IndexRefresh as A, createRenameEntry as Aa, cleanTrackedSparseDirectories as Ac, latin1ToBytes as Ai, createIdAbbreviator as Al, SignatureVerificationError as An, createMergeDriver as Ao, combineNotesOverwrite as Ar, writeWordDiffHunks as As, applyAutostash as At, parseIgnoredMode as B, resolveSigning as Ba, IndexCaseFolding as Bc, isMergeSuccessful as Bi, checkAutoCommentChar as Bl, readStoredObjectBytes as Bn, addLeadingDirs as Bo, formatTrailersOf as Br, diffColorSlotOf as Bs, NoChangesSelectedError as Bt, patchRevisionOf as C, DiffFormatter as Ca, defaultRefFormat as Cc, readBlob as Ci, nullIdLike as Cl, parseSubmoduleDiffFormat as Cn, rerereGcLocation as Co, initNotes as Cr, quoteCStyleBody as Cs, matchBoolArg as Ct, PATCH_MODES as D, createCopyEntry as Da, indexVersionConfigError as Dc, ApplyParser as Di, sequencerPrepareMessage as Dl, submoduleHeader as Dn, runRerere as Do, combineNotesCatSortUniq as Dr, lineRangesSpan as Ds, sanitizedSubject as Dt, runAddPatch as E, createAddEntry as Ea, indexFormatDefault as Ec, ApplyEngine as Ei, sequencerPostCommit as El, showSubmoduleDiffSummary as En, rerereStatus as Eo, NotesTree as Er, cutToLineRanges as Es, relativeDate as Et, hasPickaxe as F, GitCommand as Fa, sparseCheckoutConfig as Fc, newFilePatch as Fi, isGitSpace$1 as Fl, parseBufferSignedByHeader as Fn, DEFAULT_RENAME_LIMIT as Fo, mergesMode as Fr, MovedLineBuffer as Fs, removeMergeBranchState as Ft, readHeadDescription as G, signingConfigFromEntries as Ga, pruneEmptyParents as Gc, commitMessageFromOption as Gi, conflictStyleOf as Gl, verifyCommitBytes as Gn, conflictMarkerSizeOf as Go, parseTrailerWhere as Gr, wsErrorHighlightOf as Gs, WorkingCopyStashProvider as Gt, readShowUntrackedFiles as H, signPayload as Ha, findInTheWay as Hc, cleanupWith as Hi, bareAttributesResolver as Hl, signatureFormatAt as Hn, stageZeroClashes as Ho, interpretTrailers as Hr, parseColorMovedWs as Hs, StashCreateCommand as Ht, renamesValue as I, SIGNING_FAILED_LINES as Ia, sparseDirectoriesOf as Ic, ContentMergeStrategy as Ii, wsBlankLine as Il, parseGpgOutput as In, detectRenames as Io, reencodedCommitParts as Ir, WSEH_CONTEXT as Is, resetMerge as It, formatStatusText as J, RevisionResolver as Ja, statFollowingLinks as Jc, parseCleanupMode as Ji, IdentityUnknownError as Jl, CommitFilters as Jn, GIT_DIFF_BIG_FILE_THRESHOLD as Jo, trailerConfigFromEntries as Jr, reflogMessages as Js, recordWrittenStat as Jt, formatTrackingInfo as K, signingConfigOf as Ka, removeCaseVariants as Kc, completeLine as Ki, mergeVerbosityOf as Kl, verifyMergeSignature as Kn, isConflictMarkerLine as Ko, processTrailers as Kr, committerIdent as Ks, ResetCommand as Kt, TextconvCaches as L, SIGNING_KEYS as La, sparsePathAdvice as Lc, FastForwardMode as Li, wsCheckEmit as Ll, parseSignature as Ln, GIT_MAX_SCORE as Lo, amendWithTrailers as Lr, WSEH_NEW as Ls, resetUnmergedToHead as Lt, DiffCommand as M, formatDirstat as Ma, pushSparseWarnings as Mc, latin1ToText as Mi, WS_BLANK_AT_EOF as Ml, checkSignature as Mn, lowLevelMerge as Mo, LogPrinter as Mr, COLOR_MOVED_WS_ALLOW_INDENTATION_CHANGE as Ms, createAutostash as Mt, checkPickaxeOptions as N, parseDirstatParams as Na, readSparseCheckoutFile as Nc, pathToLatin1 as Ni, WS_DEFAULT_RULE as Nl, checkSignatureWith as Nn, mergeDriversOf as No, mailFromHeader as Nr, DEFAULT_DIFF_COLORS as Ns, moveHeadAsReset as Nt, patchModeFor as O, createDeleteEntry as Oa, takeIndexWarnings as Oc, bytesToLatin1 as Oi, abbrevLengths as Ol, isSubmoduleIgnoreMode as On, MergeDriverCommandMissingError as Oo, combineNotesConcatenate as Or, WORD_DIFF_MODES as Os, wrapText as Ot, formatDiffEntry as P, writeCombinedDiff as Pa, readSparseCheckoutPatterns as Pc, textToLatin1 as Pi, checkBlankAtEof as Pl, mergetagsOf as Pn, ortConfigOptions as Po, mailSubjectLine as Pr, DIFF_COLOR_SLOTS as Ps, removeBranchState as Pt, submoduleToken as Q, autoSetupRebase as Qa, worktreeModified as Qc, OperationState as Qi, committerIdentOf as Ql, RemergeTreeCommand as Qn, blobSide as Qo, globalPathspecMagic as Qr, LAZY_FETCH_DISABLED_WARNING as Qs, ListBranchMode as Qt, StatusCommand as R, SigningFailedError as Ra, sparseWarningText as Rc, MergeStatus as Ri, AutoCommentCharRemovedError as Rl, parseSignedBuffer as Rn, isBinaryContent as Ro, appendSignoff as Rr, WSEH_OLD as Rs, saveAutostash as Rt, runAddInteractive as S, parseOrderFile as Sa, defaultInitialBranch as Sc, ortResultEntries as Si, isKnownHook as Sl, openSubmoduleRepository as Sn, rerereForget as So, initCopyNotesForRewrite as Sr, writePairPatch as Ss, matchArgValue as St, runPatchSelection as T, ChangeType as Ta, IndexVersionConfigError as Tc, parseWhitespaceAction as Ti, runPostCheckoutHook as Tl, readGitmodulesEntries as Tn, rerereRemaining as To, updateNotesRef as Tr, quoteTwo as Ts, parseMaybeBool as Tt, readSubmoduleDirt as U, signRequestOf as Ua, flaggedEntryDiffers as Uc, commentPrefixOf as Ui, configBool as Ul, signatureLetter as Un, strerror as Uo, parseTrailerIfExists as Ur, parseWsErrorHighlight as Us, StashPathspecResetError as Ut, parseUntrackedFilesMode as V, signCommit as Va, entryNotUptodate as Vc, CleanupMode as Vi, attributesSourceResolver as Vl, removeSignatureHeaders as Vn, readGitlinkHead as Vo, ignoredLogMessageBytes as Vr, parseColorMoved as Vs, NoStagedChangesError as Vt, SubmoduleSummaryCommand as W, signerOf as Wa, overwriteMessage as Wc, commitCleanupMode as Wi, configValue$1 as Wl, trustRank as Wn, DEFAULT_CONFLICT_MARKER_SIZE as Wo, parseTrailerIfMissing as Wr, writeColoredHunks as Ws, StashWorktreeRemovalError as Wt, StatusImpl as X, ambiguousRemoteAdvice as Xa, untrackedUnder as Xc, stripspace as Xi, InvalidIdentError as Xl, applyMailmapToHeader as Xn, attrPathOf as Xo, trailerLinesOf as Xr, updateHead as Xs, SubmoduleUnpack as Xt, statusCommitInfo as Y, TrackMode as Ya, statThroughLeadingLinks as Yc, preparedMessageCleanup as Yi, InvalidDateError as Yl, GrepPatternError as Yn, LoadedSide as Yo, trailerConfigOf as Yr, reflogSubject as Ys, restoreWorktreeHard as Yt, formatStatusPorcelain as Z, applyRefspecs as Za, worktreeDiffers as Zc, FlatTreeCache as Zi, authorIdentOf as Zl, compileCommitGrep as Zn, blobIdOf as Zo, validateTrailerArgs as Zr, updateHeadExpecting as Zs, recursesIntoSubmodules as Zt, formatBlamePorcelain as _, createRefDecorationFilter as _a, UnknownObjectStorageFormatError as _c, parseDateMode as _i, hookHostInGitDir as _l, worktreeAdminWorkingCopy as _n, unknownRevisionMessage as _o, createNotesCommit as _r, noIndexPair as _s, expandStringArg as _t, PushStatus as a, planPathsRestore as aa, acceptedPromisorRemotes as ac, pathspecCommonPrefix as ai, treePathRefusal as al, RevFilter as an, trackableStart as ao, forkPointOf as ar, displayWidth$1 as as, externalDiffProgramOf as at, withoutCrud as au, collapsedSparseDirectories as b, orderByPatterns as ba, checkDefaultObjectStorage as bc, LogGraph as bi, hookSettingsCheck as bl, SubmoduleRepository as bn, rerereClear as bo, expandNotesRef as br, utf8$1 as bs, humanDate as bt, isPullSuccessful as c, rewriteIndex as ca, Mailmap as cc, pathspecItemMayMatch as ci, markIndexUpdate as cl, checkCandidatePath as cn, worktreeAmbiguityHints as co, patchIdOfChanges as cr, formatNameOnly as cs, whitespaceRuleError as ct, localTimezoneOffset as cu, hasUpdates as d, subjectOf$2 as da, readRepositoryMailmap as dc, treeEntryInteresting as di, commonGitFileOf as dl, refuseIfCheckedOut as dn, lstatExists as do, isFullHexObjectId as dr, formatNumstat as ds, formatConfigValue as dt, moveRefs as du, firstPlainError as ea, hasPromisorRemote as ec, latin1String as ei, planFlatRestore as el, PathspecFile as en, endOfSymbolicChain as eo, mergeBaseTree as er, contentDriver as es, revisionMergeBases as et, hostEnvironmentOf as eu, CherryPickStatus as f, switchTrees as fa, removeLegacyRemoteFile as fc, treePathspec as fi, configuredHookEntries as fl, repositoryPlaceOf as fn, parseRevisionAndPathArgs as fo, NotesError as fr, formatPatch as fs, gitConfigBool as ft, RemoteConfigStore as fu, formatBlameIncremental as g, StashApplyStatus as ga, ReinitializeObjectStorageError as gc, hostZoneName as gi, gitFileOf as gl, usesBranch as gn, parseRevisionArgs as go, copyNotesForRebase as gr, formatSummary as gs, PrettyFormatError as gt, formatBlame as h, writeIndexAsTree as ha, MissingDefaultBranchValueError as hc, DateModeError as hi, gitCommitMessageHooks as hl, useRelativePaths as hn, handleRevisionArg as ho, copyNotesForAmend as hr, formatStat as hs, parseGitColor as ht, isRebaseSuccessful as i, plainUnpackError as ia, registerPartialClone as ic, parsePathspecItem as ii, firstInvalidPath as il, LogCommand as in, pushTrackingPlan as io, commitsBaseSource as ir, diffOptsContext as is, ExternalDiffTempFiles as it, resolveIdentDate as iu, createPatchBackend as j, DEFAULT_DIRSTAT as ja, entryList as jc, latin1ToPath as ji, worktreeModeTrust as jl, bytesOf as jn, installMergeDrivers as jo, readNoteBytes as jr, COLOR_MOVED_MODE_ERROR as js, cleanupMessage as jt, promptIndex as k, createModifyEntry as ka, SparseUnpack as kc, cUnquote as ki, coreBool as kl, parseGitmodules as kn, MergeDriverFailedError as ko, combineNotesIgnore as kr, compileWordRegex as ks, AUTOSTASH_SAVED_LINES as kt, RefUpdateStatus as l, storeFlatTree as la, readMailmapBlob as lc, pathspecName as li, HookSession as ll, findLinkedWorktree as ln, checkFilename as lo, patchIdsOfPatchText as lr, formatNameStatus as ls, CONFIG_VALUE_TYPES as lt, parseGitDate as lu, formatAnnotate as m, updateIndexCacheTree as ma, InvalidInitialBranchError as mc, DEFAULT_DATE_MODE as mi, gitCommitAfterHooks as ml, shortBranchName as mn, verifyNonFilename as mo, copyNoteForRewrite as mr, formatShortstat as ms, normalizeConfigValue as mt, RebaseAction as n, indexChanges as na, promisorOf as nc, matchPathspecSeen as ni, restoreCaseOptions as nl, STASH_REF as nn, installTracking as no, storedBase as nr, countLines as ns, textconvRunnerOf as nt, resolveAuthorIdent as nu, getFailedUpdates as o, readIndex as oa, promisorRemoteReplyOf as oc, pathspecErrors as oi, withTreePathRefusal as ol, WorktreeListCommand as on, uniqueTrackingName as oo, PathspecAttributes as or, driverOf as os, DEFAULT_DECORATION_COLORS as ot, approxidateCareful$1 as ou, BlameColorError as p, treeDelta as pa, InvalidDefaultBranchError as pc, untrackedScanPathspec as pi, configuredHooks as pl, requireWorktrees as pn, verifyFilename as po, commitNotes as pr, formatRawPair as ps, gitConfigColorBool as pt, listRemoteNames as pu, StatusPrinter as q, signingKeyIdOf as qa, removeDirectoryIfEmpty as qc, editorCleanupMode as qi, DEFAULT_IDENT as ql, verifyTagBytes as qn, writePairCheck as qo, signoffLine as qr, reflogLine as qs, checkFlaggedEntries as qt, RebaseStatus as r, indexChangesFromTree as ra, promisorRemotes as rc, parsePathspec as ri, writeTreeRestorePlan as rl, StashListCommand as rn, planTracking as ro, MergeBaseGraph as rr, diffDriverOf as rs, ExternalDiffDiedError as rt, resolveCommitterIdent as ru, isPushSuccessful as s, refsWatched as sa, httpClientSettingsOf as sc, pathspecItemBytes as si, worktreePathRules as sl, shortenUnambiguousRef as sn, upstreamMissingError as so, PatchIds as sr, externalDiffMetainfo as ss, readDiffColorSettings as st, formatRfc2822Date as su, RevertStatus as t, flatTree as ta, installPromisorFetcher as tc, matchPathspec as ti, planTreeRestore as tl, StashApplyCommand as tn, guessRemoteBranch as to, mergeStoredTrees as tr, contentSide as ts, installTextconvRunner as tt, identConfigOf as tu, getSuccessfulUpdates as u, storeFlatTreeOver as ua, readMailmapFile as uc, psEqual as ui, LOCAL_REPO_ENV as ul, parseExpiry as un, looksLikePathspec as uo, canonicalObjectId as ur, formatNoIndexDiff as us, ConfigValueDeath as ut, deleteRefs as uu, AddCommand as v, decorateFullRefs as va, UnknownRefFormatError as vc, showDate as vi, hookHostOf as vl, worktreeUsingBranch as vn, RerereError as vo, defaultNotesRef as vr, pprintRename as vs, formatCommitPretty as vt, pathPatchMode as w, diffEntryToPair as wa, isValidBranchName$1 as wc, ApplyCommand as wi, refTransactionHookOf as wl, readDiffSubmoduleConfig as wn, rerereHostOf as wo, readRef as wr, quotePath$1 as ws, parseColorSpec as wt, sparseIndexAsRead as x, orderRank as xa, defaultBranchHint as xc, graphColumnColors as xi, hookSettingsFromEntries as xl, SubmoduleWalkError as xn, rerereDiff as xo, finishCopyNotesForRewrite as xr, writeHeaderOnlyPatch as xs, loadRefDecorations as xt, SPARSE_INDEX_EXPANDED_HINT as y, DiffPickaxe as ya, UnsupportedObjectStorageError as yc, GRAPH_COLUMN_COLORS_ANSI as yi, hookRunnerOf as yl, NULL_OBJECT_ID as yn, normalizeConflicts as yo, expandLooseNotesRef as yr, statSummary as ys, formatRefDecorations as yt, cutLine as z, refuseCommitSigning as za, updateSparsity as zc, MergeStrategy as zi, autoCommentCharLines as zl, parseSshOutput as zn, IndexAdder as zo, appendTrailers as zr, coloredHunkHeader as zs, squashMessage as zt };
50246
+ export { submoduleToken as $, TrackMode as $a, findInTheWay as $c, stripspace as $i, AutoCommentCharRemovedError as $l, applyMailmapToHeader as $n, GIT_DIFF_BIG_FILE_THRESHOLD as $o, trailerLinesOf as $r, reflogMessages as $s, SubmoduleUnpack as $t, IndexRefresh as A, createCopyEntry as Aa, checkDefaultObjectStorage as Ac, ApplyParser as Ai, hookRunnerOf as Al, submoduleHeader as An, rerereRemaining as Ao, combineNotesCatSortUniq as Ar, quoteTwo as As, AUTOSTASH_SAVED_LINES as At, parseIgnoredMode as B, SIGNING_KEYS as Ba, SparseUnpack as Bc, FastForwardMode as Bi, FSMONITOR_DAEMON_IPC_NAME as Bl, parseSignature as Bn, DEFAULT_RENAME_LIMIT as Bo, amendWithTrailers as Br, MovedLineBuffer as Bs, squashMessage as Bt, patchRevisionOf as C, orderByPatterns as Ca, InvalidDefaultBranchError as Cc, LogGraph as Ci, configuredHookEntries as Cl, SubmoduleRepository as Cn, normalizeConflicts as Co, expandNotesRef as Cr, pprintRename as Cs, matchArgValue as Ct, localTimezoneOffset as Cu, PATCH_MODES as D, diffEntryToPair as Da, UnknownObjectStorageFormatError as Dc, ApplyCommand as Di, gitFileOf as Dl, readDiffSubmoduleConfig as Dn, rerereForget as Do, readRef as Dr, writePairPatch as Ds, relativeDate as Dt, RemoteConfigStore as Du, runAddPatch as E, DiffFormatter as Ea, ReinitializeObjectStorageError as Ec, readBlob as Ei, gitCommitMessageHooks as El, parseSubmoduleDiffFormat as En, rerereEngineOf as Eo, initNotes as Er, writeHeaderOnlyPatch as Es, parseMaybeBool as Et, moveRefs as Eu, hasPickaxe as F, formatDirstat as Fa, unknownObjectStorageFormat as Fc, latin1ToText as Fi, refTransactionHookOf as Fl, checkSignature as Fn, createMergeDriver as Fo, LogPrinter as Fr, writeWordDiffHunks as Fs, removeBranchState as Ft, SubmoduleSummaryCommand as G, signPayload as Ga, readSparseCheckoutPatterns as Gc, cleanupWith as Gi, createIdAbbreviator as Gl, signatureFormatAt as Gn, addLeadingDirs as Go, interpretTrailers as Gr, diffColorSlotOf as Gs, StashWorktreeRemovalError as Gt, readShowUntrackedFiles as H, refuseCommitSigning as Ha, entryList as Hc, MergeStrategy as Hi, queryFsmonitorDaemon as Hl, parseSshOutput as Hn, GIT_MAX_SCORE as Ho, appendTrailers as Hr, WSEH_NEW as Hs, NoStagedChangesError as Ht, renamesValue as I, parseDirstatParams as Ia, IndexVersionConfigError as Ic, pathToLatin1 as Ii, runPostCheckoutHook as Il, checkSignatureWith as In, installMergeDrivers as Io, mailFromHeader as Ir, COLOR_MOVED_MODE_ERROR as Is, removeMergeBranchState as It, StatusPrinter as J, signerOf as Ja, sparsePathAdvice as Jc, commitMessageFromOption as Ji, WS_DEFAULT_RULE as Jl, verifyCommitBytes as Jn, strerror as Jo, parseTrailerWhere as Jr, parseWsErrorHighlight as Js, checkFlaggedEntries as Jt, readHeadDescription as K, signRequestOf as Ka, sparseCheckoutConfig as Kc, commentPrefixOf as Ki, worktreeModeTrust as Kl, signatureLetter as Kn, readGitlinkHead as Ko, parseTrailerIfExists as Kr, parseColorMoved as Ks, WorkingCopyStashProvider as Kt, TextconvCaches as L, writeCombinedDiff as La, indexFormatDefault as Lc, textToLatin1 as Li, sequencerPostCommit as Ll, mergetagsOf as Ln, lowLevelMerge as Lo, mailSubjectLine as Lr, COLOR_MOVED_WS_ALLOW_INDENTATION_CHANGE as Ls, resetMerge as Lt, DiffCommand as M, createModifyEntry as Ma, defaultInitialBranch as Mc, cUnquote as Mi, hookSettingsFromEntries as Ml, parseGitmodules as Mn, runRerere as Mo, combineNotesIgnore as Mr, lineRangesSpan as Ms, cleanupMessage as Mt, checkPickaxeOptions as N, createRenameEntry as Na, defaultRefFormat as Nc, latin1ToBytes as Ni, isKnownHook as Nl, SignatureVerificationError as Nn, MergeDriverCommandMissingError as No, combineNotesOverwrite as Nr, WORD_DIFF_MODES as Ns, createAutostash as Nt, patchModeFor as O, ChangeType as Oa, UnknownRefFormatError as Oc, parseWhitespaceAction as Oi, hookHostInGitDir as Ol, readGitmodulesEntries as On, rerereGcLocation as Oo, updateNotesRef as Or, quoteCStyleBody as Os, sanitizedSubject as Ot, listRemoteNames as Ou, formatDiffEntry as P, DEFAULT_DIRSTAT as Pa, isValidBranchName$1 as Pc, latin1ToPath as Pi, nullIdLike as Pl, bytesOf as Pn, MergeDriverFailedError as Po, readNoteBytes as Pr, compileWordRegex as Ps, moveHeadAsReset as Pt, formatStatusPorcelain as Q, RevisionResolver as Qa, entryNotUptodate as Qc, preparedMessageCleanup as Qi, wsCheckEmit as Ql, GrepPatternError as Qn, writePairCheck as Qo, trailerConfigOf as Qr, reflogLine as Qs, restoreWorktreeHard as Qt, StatusCommand as R, GitCommand as Ra, indexVersionConfigError as Rc, newFilePatch as Ri, sequencerPrepareMessage as Rl, parseBufferSignedByHeader as Rn, mergeDriversOf as Ro, mergesMode as Rr, DEFAULT_DIFF_COLORS as Rs, resetUnmergedToHead as Rt, runAddInteractive as S, DiffPickaxe as Sa, removeLegacyRemoteFile as Sc, GRAPH_COLUMN_COLORS_ANSI as Si, commonGitFileOf as Sl, NULL_OBJECT_ID as Sn, RerereError as So, expandLooseNotesRef as Sr, noIndexPair as Ss, loadRefDecorations as St, formatRfc2822Date as Su, runPatchSelection as T, parseOrderFile as Ta, MissingDefaultBranchValueError as Tc, ortResultEntries as Ti, gitCommitAfterHooks as Tl, openSubmoduleRepository as Tn, rerereDiff as To, initCopyNotesForRewrite as Tr, utf8$1 as Ts, parseColorSpec as Tt, deleteRefs as Tu, readSubmoduleDirt as U, resolveSigning as Ua, pushSparseWarnings as Uc, isMergeSuccessful as Ui, abbrevLengths as Ul, readStoredObjectBytes as Un, isBinaryContent as Uo, formatTrailersOf as Ur, WSEH_OLD as Us, StashCreateCommand as Ut, parseUntrackedFilesMode as V, SigningFailedError as Va, cleanTrackedSparseDirectories as Vc, MergeStatus as Vi, encodePacketized as Vl, parseSignedBuffer as Vn, detectRenames as Vo, appendSignoff as Vr, WSEH_CONTEXT as Vs, NoChangesSelectedError as Vt, submoduleNotSupportedWarning as W, signCommit as Wa, readSparseCheckoutFile as Wc, CleanupMode as Wi, coreBool as Wl, removeSignatureHeaders as Wn, IndexAdder as Wo, ignoredLogMessageBytes as Wr, coloredHunkHeader as Ws, StashPathspecResetError as Wt, statusCommitInfo as X, signingConfigOf as Xa, updateSparsity as Xc, editorCleanupMode as Xi, isGitSpace$1 as Xl, verifyTagBytes as Xn, conflictMarkerSizeOf as Xo, signoffLine as Xr, wsErrorHighlightOf as Xs, recordWrittenStat as Xt, formatStatusText as Y, signingConfigFromEntries as Ya, sparseWarningText as Yc, completeLine as Yi, checkBlankAtEof as Yl, verifyMergeSignature as Yn, DEFAULT_CONFLICT_MARKER_SIZE as Yo, processTrailers as Yr, writeColoredHunks as Ys, fsmonitorKeptEntries as Yt, StatusImpl as Z, signingKeyIdOf as Za, IndexCaseFolding as Zc, parseCleanupMode as Zi, wsBlankLine as Zl, CommitFilters as Zn, isConflictMarkerLine as Zo, trailerConfigFromEntries as Zr, committerIdent as Zs, restoreKeptEntries as Zt, formatBlamePorcelain as _, updateIndexCacheTree as _a, readAllBytes as _c, DEFAULT_DATE_MODE as _i, withTreePathRefusal as _l, shortBranchName as _n, verifyFilename as _o, copyNoteForRewrite as _r, formatPatch as _s, PrettyFormatError as _t, resolveAuthorIdent as _u, PushStatus as a, indexChanges as aa, hasPromisorRemote as ac, matchPathspecSeen as ai, statFollowingLinks as al, STASH_REF as an, guessRemoteBranch as ao, storedBase as ar, contentDriver as as, ExternalDiffTempFiles as at, configValue$1 as au, collapsedSparseDirectories as b, createRefDecorationFilter as ba, readMailmapFile as bc, parseDateMode as bi, HookSession as bl, worktreeAdminWorkingCopy as bn, parseRevisionArgs as bo, createNotesCommit as br, formatStat as bs, formatRefDecorations as bt, withoutCrud as bu, isPullSuccessful as c, planPathsRestore as ca, promisorRemotes as cc, pathspecCommonPrefix as ci, worktreeDiffers as cl, RevFilter as cn, pushTrackingPlan as co, forkPointOf as cr, diffDriverOf as cs, readDiffColorSettings as ct, DEFAULT_IDENT as cu, hasUpdates as d, rewriteIndex as da, promisorRemoteReplyOf as dc, pathspecItemMayMatch as di, planFlatRestore as dl, checkCandidatePath as dn, upstreamMissingError as do, patchIdOfChanges as dr, driverOf as ds, ConfigValueDeath as dt, InvalidIdentError as du, FlatTreeCache as ea, reflogSubject as ec, validateTrailerArgs as ei, flaggedEntryDiffers as el, recursesIntoSubmodules as en, ambiguousRemoteAdvice as eo, compileCommitGrep as er, LoadedSide as es, RevParseCommand as et, autoCommentCharLines as eu, CherryPickStatus as f, storeFlatTree as fa, httpClientSettingsOf as fc, pathspecName as fi, planTreeRestore as fl, findLinkedWorktree as fn, worktreeAmbiguityHints as fo, patchIdsOfPatchText as fr, externalDiffMetainfo as fs, formatConfigValue as ft, authorIdentOf as fu, formatBlameIncremental as g, treeDelta as ga, objectTypeOfMode as gc, untrackedScanPathspec as gi, treePathRefusal as gl, requireWorktrees as gn, parseRevisionAndPathArgs as go, commitNotes as gr, formatNumstat as gs, parseGitColor as gt, identConfigOf as gu, formatBlame as h, switchTrees as ha, concatBytes$3 as hc, treePathspec as hi, firstInvalidPath as hl, repositoryPlaceOf as hn, lstatExists as ho, NotesError as hr, formatNoIndexDiff as hs, normalizeConfigValue as ht, hostEnvironmentOf as hu, isRebaseSuccessful as i, flatTree as ia, createPromisorFetcher as ic, matchPathspec as ii, removeDirectoryIfEmpty as il, StashApplyCommand as in, endOfSymbolicChain as io, mergeStoredTrees as ir, computeDiffstat as is, ExternalDiffDiedError as it, configBool as iu, createPatchBackend as j, createDeleteEntry as ja, defaultBranchHint as jc, bytesToLatin1 as ji, hookSettingsCheck as jl, isSubmoduleIgnoreMode as jn, rerereStatus as jo, combineNotesConcatenate as jr, cutToLineRanges as js, applyAutostash as jt, promptIndex as k, createAddEntry as ka, UnsupportedObjectStorageError as kc, ApplyEngine as ki, hookHostOf as kl, showSubmoduleDiffSummary as kn, rerereHostOf as ko, NotesTree as kr, quotePath$1 as ks, wrapText as kt, RefUpdateStatus as l, readIndex as la, registerPartialClone as lc, pathspecErrors as li, worktreeModified as ll, WorktreeListCommand as ln, trackableStart as lo, PathspecAttributes as lr, diffOptsContext as ls, whitespaceRuleError as lt, IdentityUnknownError as lu, formatAnnotate as m, subjectOf$2 as ma, SHORT_MAGIC as mc, treeEntryInteresting as mi, writeTreeRestorePlan as ml, refuseIfCheckedOut as mn, looksLikePathspec as mo, isFullHexObjectId as mr, formatNameStatus as ms, gitConfigColorBool as mt, findIdent as mu, RebaseAction as n, conflictsComment as na, updateHeadExpecting as nc, latin1Bytes as ni, pruneEmptyParents as nl, ResetMode as nn, autoSetupRebase as no, remergeObjectsView as nr, blobIdOf as ns, installTextconvRunner as nt, attributesSourceResolver as nu, getFailedUpdates as o, indexChangesFromTree as oa, installPromisorFetcher as oc, parsePathspec as oi, statThroughLeadingLinks as ol, StashListCommand as on, installTracking as oo, MergeBaseGraph as or, contentSide as os, externalDiffProgramOf as ot, conflictStyleOf as ou, BlameColorError as p, storeFlatTreeOver as pa, CorruptTreeError as pc, psEqual as pi, restoreCaseOptions as pl, parseExpiry as pn, checkFilename as po, canonicalObjectId as pr, formatNameOnly as ps, gitConfigBool as pt, committerIdentOf as pu, formatTrackingInfo as q, signTagCompat as qa, sparseDirectoriesOf as qc, commitCleanupMode as qi, WS_BLANK_AT_EOF as ql, trustRank as qn, stageZeroClashes as qo, parseTrailerIfMissing as qr, parseColorMovedWs as qs, ResetCommand as qt, RebaseStatus as r, firstPlainError as ra, LAZY_FETCH_DISABLED_WARNING as rc, latin1String as ri, removeCaseVariants as rl, PathspecFile as rn, disableHint as ro, mergeBaseTree as rr, blobSide as rs, textconvRunnerOf as rt, bareAttributesResolver as ru, isPushSuccessful as s, plainUnpackError as sa, promisorOf as sc, parsePathspecItem as si, untrackedUnder as sl, LogCommand as sn, planTracking as so, commitsBaseSource as sr, countLines as ss, DEFAULT_DECORATION_COLORS as st, mergeVerbosityOf as su, RevertStatus as t, OperationState as ta, updateHead as tc, globalPathspecMagic as ti, overwriteMessage as tl, ListBranchMode as tn, applyRefspecs as to, RemergeTreeCommand as tr, attrPathOf as ts, revisionMergeBases as tt, checkAutoCommentChar as tu, getSuccessfulUpdates as u, refsWatched as ua, acceptedPromisorRemotes as uc, pathspecItemBytes as ui, checkoutFreshTree as ul, shortenUnambiguousRef as un, uniqueTrackingName as uo, PatchIds as ur, displayWidth$1 as us, CONFIG_VALUE_TYPES as ut, InvalidDateError as uu, AddCommand as v, writeIndexAsTree as va, Mailmap as vc, DateModeError as vi, worktreePathRules as vl, useRelativePaths as vn, verifyNonFilename as vo, copyNotesForAmend as vr, formatRawPair as vs, expandStringArg as vt, resolveCommitterIdent as vu, pathPatchMode as w, orderRank as wa, InvalidInitialBranchError as wc, graphColumnColors as wi, configuredHooks as wl, SubmoduleWalkError as wn, rerereClear as wo, finishCopyNotesForRewrite as wr, statSummary as ws, matchBoolArg as wt, parseGitDate as wu, sparseIndexAsRead as x, decorateFullRefs as xa, readRepositoryMailmap as xc, showDate as xi, LOCAL_REPO_ENV as xl, worktreeUsingBranch as xn, unknownRevisionMessage as xo, defaultNotesRef as xr, formatSummary as xs, humanDate as xt, approxidateCareful$1 as xu, SPARSE_INDEX_EXPANDED_HINT as y, StashApplyStatus as ya, readMailmapBlob as yc, hostZoneName as yi, markIndexUpdate as yl, usesBranch as yn, handleRevisionArg as yo, copyNotesForRebase as yr, formatShortstat as ys, formatCommitPretty as yt, resolveIdentDate as yu, cutLine as z, SIGNING_FAILED_LINES as za, takeIndexWarnings as zc, ContentMergeStrategy as zi, fsmonitorModeOf as zl, parseGpgOutput as zn, ortConfigOptions as zo, reencodedCommitParts as zr, DIFF_COLOR_SLOTS as zs, saveAutostash as zt };