type-git 0.1.0 → 0.2.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.
package/dist/index.d.cts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { Z as AddOpts, bC as BareRepo, a0 as BranchCreateOpts, a1 as BranchDeleteOpts, _ as BranchInfo, bh as BranchOperations, $ as BranchOpts, a2 as CheckoutBranchOpts, a4 as CheckoutOpts, a3 as CheckoutPathOpts, am as CherryPickOpts, an as CleanOpts, v as CliRunner, w as CliRunnerOptions, x as CloneOpts, U as Commit, a5 as CommitOpts, a6 as CommitResult, bt as ConfigEntry, bu as ConfigGetOpts, by as ConfigKey, bw as ConfigListOpts, bz as ConfigOperations, bx as ConfigSchema, bv as ConfigSetOpts, C as CreateGitOptions, a8 as DiffEntry, a7 as DiffOpts, a9 as DiffResult, W as FetchOpts, X as ForceWithLeaseOpts, G as GIT_LOG_FORMAT, H as Git, b as GitProgressInfo, E as GlobalConfigListOpts, F as GlobalConfigOperations, A as GlobalLfsInstallOpts, D as GlobalLfsOperations, B as GlobalLfsUninstallOpts, I as InitOpts, L as LEGACY_GIT_VERSION, a_ as LfsCheckoutOpts, b2 as LfsEnvInfo, bg as LfsExtraOperations, aP as LfsFetchOpts, aS as LfsFileEntry, aW as LfsLockEntry, aX as LfsLockOpts, aZ as LfsLocksOpts, aT as LfsLsFilesOpts, b1 as LfsMigrateExportOpts, b0 as LfsMigrateImportOpts, a$ as LfsMigrateInfoOpts, bf as LfsOperations, b5 as LfsPreDownloadOpts, b6 as LfsPreDownloadResult, b3 as LfsPreUploadOpts, b4 as LfsPreUploadResult, e as LfsProgressInfo, aO as LfsPruneOpts, aL as LfsPullOpts, aM as LfsPushOpts, aK as LfsStatus, aN as LfsStatusOpts, aU as LfsTrackEntry, aV as LfsTrackOpts, aY as LfsUnlockOpts, V as LogOpts, y as LsRemoteOpts, f as LsRemoteRef, z as LsRemoteResult, N as LsTreeEntry, g as LsTreeObjectType, O as LsTreeOpts, M as MIN_GIT_VERSION, aa as MergeOpts, ab as MergeResult, ao as MvOpts, NodeExecAdapter, NodeFsAdapter, P as ParsedCommit, h as ParsedLsTreeEntry, i as ParsedWorktree, j as PorcelainV2Entry, ac as PullOpts, Y as PushOpts, ap as RebaseOpts, bl as RemoteAddOpts, bk as RemoteInfo, bs as RemoteOperations, bo as RemotePruneOpts, bq as RemoteSetBranchesOpts, bm as RemoteSetHeadOpts, bn as RemoteShowOpts, bp as RemoteUpdateOpts, br as RemoteUrlOpts, R as RepoBase, aQ as RepoLfsInstallOpts, aR as RepoLfsUninstallOpts, J as RepoLsRemoteOpts, K as RepoLsRemoteResult, ad as ResetOpts, aq as RestoreOpts, au as RevParseBooleanQuery, av as RevParseListOpts, aw as RevParseListQuery, ay as RevParseOtherQuery, az as RevParsePathFormat, aA as RevParsePathOpts, at as RevParsePathQuery, ax as RevParseRefOpts, ar as RevertOpts, ae as RmOpts, as as ShowOpts, ah as StashApplyOpts, af as StashEntry, bi as StashOperations, ag as StashPushOpts, S as StatusEntry, T as StatusOpts, Q as StatusPorcelain, aC as SubmoduleAddOpts, aD as SubmoduleDeinitOpts, aG as SubmoduleForeachOpts, aJ as SubmoduleInfo, bA as SubmoduleOperations, aB as SubmoduleOpts, aI as SubmoduleSetBranchOpts, aE as SubmoduleStatusOpts, aF as SubmoduleSummaryOpts, aH as SubmoduleSyncOpts, ai as SwitchOpts, al as TagCreateOpts, aj as TagInfo, ak as TagListOpts, bj as TagOperations, TypeGit, TypeGitOptions, b7 as Worktree, b8 as WorktreeAddOpts, bd as WorktreeLockOpts, bb as WorktreeMoveOpts, be as WorktreeOperations, ba as WorktreePruneOpts, b9 as WorktreeRemoveOpts, bc as WorktreeRepairOpts, bB as WorktreeRepo, c as createGit, a as createGitSync, createNodeAdapters, d as detectErrorCategory, p as parseGitLog, k as parseGitProgress, l as parseJson, m as parseKeyValue, n as parseLfsProgress, o as parseLines, q as parseLsRemote, r as parseLsTree, s as parsePorcelainV2, t as parseRecords, u as parseWorktreeList } from './adapters/node/index.cjs';
2
- export { A as AdapterFactory, C as Capabilities, q as CommandSpec, s as Credential, t as CredentialConfig, r as CredentialRequest, E as ExecAdapter, e as ExecOpts, i as ExecutionContext, F as FsAdapter, o as GitArgumentError, j as GitError, G as GitErrorCategory, m as GitErrorKind, h as GitOpenOptions, g as GitProgress, L as LfsMode, l as LfsProgress, N as NonEmptyString, O as OutputContract, f as RawResult, p as Runtime, R as RuntimeAdapters, c as SpawnHandle, S as SpawnOptions, b as SpawnResult, a as StreamHandler, d as TailHandle, T as TailOptions, k as isNonEmpty, n as nonEmpty } from './adapters-DehG3CsV.cjs';
2
+ export { A as AdapterFactory, C as Capabilities, q as CommandSpec, s as Credential, t as CredentialConfig, r as CredentialRequest, E as ExecAdapter, e as ExecOpts, i as ExecutionContext, F as FsAdapter, o as GitArgumentError, j as GitError, G as GitErrorCategory, m as GitErrorKind, h as GitOpenOptions, g as GitProgress, L as LfsMode, l as LfsProgress, N as NonEmptyString, O as OutputContract, f as RawResult, p as Runtime, R as RuntimeAdapters, c as SpawnHandle, S as SpawnOptions, b as SpawnResult, a as StreamHandler, d as TailHandle, T as TailOptions, k as isNonEmpty, n as nonEmpty } from './adapters-BFRtEriX.cjs';
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  export { Z as AddOpts, bC as BareRepo, a0 as BranchCreateOpts, a1 as BranchDeleteOpts, _ as BranchInfo, bh as BranchOperations, $ as BranchOpts, a2 as CheckoutBranchOpts, a4 as CheckoutOpts, a3 as CheckoutPathOpts, am as CherryPickOpts, an as CleanOpts, v as CliRunner, w as CliRunnerOptions, x as CloneOpts, U as Commit, a5 as CommitOpts, a6 as CommitResult, bt as ConfigEntry, bu as ConfigGetOpts, by as ConfigKey, bw as ConfigListOpts, bz as ConfigOperations, bx as ConfigSchema, bv as ConfigSetOpts, C as CreateGitOptions, a8 as DiffEntry, a7 as DiffOpts, a9 as DiffResult, W as FetchOpts, X as ForceWithLeaseOpts, G as GIT_LOG_FORMAT, H as Git, b as GitProgressInfo, E as GlobalConfigListOpts, F as GlobalConfigOperations, A as GlobalLfsInstallOpts, D as GlobalLfsOperations, B as GlobalLfsUninstallOpts, I as InitOpts, L as LEGACY_GIT_VERSION, a_ as LfsCheckoutOpts, b2 as LfsEnvInfo, bg as LfsExtraOperations, aP as LfsFetchOpts, aS as LfsFileEntry, aW as LfsLockEntry, aX as LfsLockOpts, aZ as LfsLocksOpts, aT as LfsLsFilesOpts, b1 as LfsMigrateExportOpts, b0 as LfsMigrateImportOpts, a$ as LfsMigrateInfoOpts, bf as LfsOperations, b5 as LfsPreDownloadOpts, b6 as LfsPreDownloadResult, b3 as LfsPreUploadOpts, b4 as LfsPreUploadResult, e as LfsProgressInfo, aO as LfsPruneOpts, aL as LfsPullOpts, aM as LfsPushOpts, aK as LfsStatus, aN as LfsStatusOpts, aU as LfsTrackEntry, aV as LfsTrackOpts, aY as LfsUnlockOpts, V as LogOpts, y as LsRemoteOpts, f as LsRemoteRef, z as LsRemoteResult, N as LsTreeEntry, g as LsTreeObjectType, O as LsTreeOpts, M as MIN_GIT_VERSION, aa as MergeOpts, ab as MergeResult, ao as MvOpts, NodeExecAdapter, NodeFsAdapter, P as ParsedCommit, h as ParsedLsTreeEntry, i as ParsedWorktree, j as PorcelainV2Entry, ac as PullOpts, Y as PushOpts, ap as RebaseOpts, bl as RemoteAddOpts, bk as RemoteInfo, bs as RemoteOperations, bo as RemotePruneOpts, bq as RemoteSetBranchesOpts, bm as RemoteSetHeadOpts, bn as RemoteShowOpts, bp as RemoteUpdateOpts, br as RemoteUrlOpts, R as RepoBase, aQ as RepoLfsInstallOpts, aR as RepoLfsUninstallOpts, J as RepoLsRemoteOpts, K as RepoLsRemoteResult, ad as ResetOpts, aq as RestoreOpts, au as RevParseBooleanQuery, av as RevParseListOpts, aw as RevParseListQuery, ay as RevParseOtherQuery, az as RevParsePathFormat, aA as RevParsePathOpts, at as RevParsePathQuery, ax as RevParseRefOpts, ar as RevertOpts, ae as RmOpts, as as ShowOpts, ah as StashApplyOpts, af as StashEntry, bi as StashOperations, ag as StashPushOpts, S as StatusEntry, T as StatusOpts, Q as StatusPorcelain, aC as SubmoduleAddOpts, aD as SubmoduleDeinitOpts, aG as SubmoduleForeachOpts, aJ as SubmoduleInfo, bA as SubmoduleOperations, aB as SubmoduleOpts, aI as SubmoduleSetBranchOpts, aE as SubmoduleStatusOpts, aF as SubmoduleSummaryOpts, aH as SubmoduleSyncOpts, ai as SwitchOpts, al as TagCreateOpts, aj as TagInfo, ak as TagListOpts, bj as TagOperations, TypeGit, TypeGitOptions, b7 as Worktree, b8 as WorktreeAddOpts, bd as WorktreeLockOpts, bb as WorktreeMoveOpts, be as WorktreeOperations, ba as WorktreePruneOpts, b9 as WorktreeRemoveOpts, bc as WorktreeRepairOpts, bB as WorktreeRepo, c as createGit, a as createGitSync, createNodeAdapters, d as detectErrorCategory, p as parseGitLog, k as parseGitProgress, l as parseJson, m as parseKeyValue, n as parseLfsProgress, o as parseLines, q as parseLsRemote, r as parseLsTree, s as parsePorcelainV2, t as parseRecords, u as parseWorktreeList } from './adapters/node/index.js';
2
- export { A as AdapterFactory, C as Capabilities, q as CommandSpec, s as Credential, t as CredentialConfig, r as CredentialRequest, E as ExecAdapter, e as ExecOpts, i as ExecutionContext, F as FsAdapter, o as GitArgumentError, j as GitError, G as GitErrorCategory, m as GitErrorKind, h as GitOpenOptions, g as GitProgress, L as LfsMode, l as LfsProgress, N as NonEmptyString, O as OutputContract, f as RawResult, p as Runtime, R as RuntimeAdapters, c as SpawnHandle, S as SpawnOptions, b as SpawnResult, a as StreamHandler, d as TailHandle, T as TailOptions, k as isNonEmpty, n as nonEmpty } from './adapters-DehG3CsV.js';
2
+ export { A as AdapterFactory, C as Capabilities, q as CommandSpec, s as Credential, t as CredentialConfig, r as CredentialRequest, E as ExecAdapter, e as ExecOpts, i as ExecutionContext, F as FsAdapter, o as GitArgumentError, j as GitError, G as GitErrorCategory, m as GitErrorKind, h as GitOpenOptions, g as GitProgress, L as LfsMode, l as LfsProgress, N as NonEmptyString, O as OutputContract, f as RawResult, p as Runtime, R as RuntimeAdapters, c as SpawnHandle, S as SpawnOptions, b as SpawnResult, a as StreamHandler, d as TailHandle, T as TailOptions, k as isNonEmpty, n as nonEmpty } from './adapters-BFRtEriX.js';
package/dist/index.js CHANGED
@@ -383,7 +383,7 @@ function parseGitLog(stdout) {
383
383
  if (fields.length < 11) {
384
384
  continue;
385
385
  }
386
- const hash = fields[0];
386
+ const hash = fields[0]?.trim();
387
387
  const abbrevHash = fields[1];
388
388
  const parentsStr = fields[2];
389
389
  const authorName = fields[3];
@@ -5979,6 +5979,13 @@ var NodeExecAdapter = class {
5979
5979
  wait: () => waitPromise,
5980
5980
  kill: (sig) => {
5981
5981
  child.kill(sig ?? "SIGTERM");
5982
+ },
5983
+ [Symbol.asyncDispose]: async () => {
5984
+ if (child.exitCode === null) {
5985
+ child.kill("SIGTERM");
5986
+ }
5987
+ await waitPromise.catch(() => {
5988
+ });
5982
5989
  }
5983
5990
  };
5984
5991
  }
@@ -6026,7 +6033,8 @@ function createTailPolling(options) {
6026
6033
  state.resolveNext = null;
6027
6034
  }
6028
6035
  };
6029
- startPollingLoop(adapter, state, signal, pollInterval, stop).catch(() => {
6036
+ const pollingPromise = startPollingLoop(adapter, state, signal, pollInterval, stop);
6037
+ pollingPromise.catch(() => {
6030
6038
  });
6031
6039
  const lines = {
6032
6040
  [Symbol.asyncIterator]() {
@@ -6048,7 +6056,15 @@ function createTailPolling(options) {
6048
6056
  };
6049
6057
  }
6050
6058
  };
6051
- return { lines, stop };
6059
+ return {
6060
+ lines,
6061
+ stop,
6062
+ [Symbol.asyncDispose]: async () => {
6063
+ stop();
6064
+ await pollingPromise.catch(() => {
6065
+ });
6066
+ }
6067
+ };
6052
6068
  }
6053
6069
  async function startPollingLoop(adapter, state, signal, pollInterval, stop) {
6054
6070
  let position = 0;
@@ -6072,6 +6088,9 @@ async function startPollingLoop(adapter, state, signal, pollInterval, stop) {
6072
6088
  }
6073
6089
  }
6074
6090
  }
6091
+ if (state.stopped || signal?.aborted) {
6092
+ break;
6093
+ }
6075
6094
  await adapter.sleep(pollInterval);
6076
6095
  }
6077
6096
  stop();
@@ -6160,16 +6179,26 @@ var NodeFsAdapter = class {
6160
6179
  sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms))
6161
6180
  };
6162
6181
  const polling = createTailPolling({ adapter, signal, pollInterval });
6163
- const originalStop = polling.stop;
6164
- const enhancedStop = () => {
6165
- originalStop();
6182
+ const closeFileHandle = async () => {
6166
6183
  if (state.file) {
6167
- state.file.close().catch(() => {
6184
+ await state.file.close().catch(() => {
6168
6185
  });
6169
6186
  state.file = null;
6170
6187
  }
6171
6188
  };
6172
- return { lines: polling.lines, stop: enhancedStop };
6189
+ const originalStop = polling.stop;
6190
+ const enhancedStop = () => {
6191
+ originalStop();
6192
+ void closeFileHandle();
6193
+ };
6194
+ return {
6195
+ lines: polling.lines,
6196
+ stop: enhancedStop,
6197
+ [Symbol.asyncDispose]: async () => {
6198
+ await polling[Symbol.asyncDispose]();
6199
+ await closeFileHandle();
6200
+ }
6201
+ };
6173
6202
  }
6174
6203
  };
6175
6204