@statewalker/vcs-commands 0.3.2 → 0.5.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 (133) hide show
  1. package/README.md +19 -0
  2. package/dist/commands/add-command.d.ts +0 -6
  3. package/dist/commands/add-command.d.ts.map +1 -1
  4. package/dist/commands/blame-command.d.ts +14 -0
  5. package/dist/commands/blame-command.d.ts.map +1 -1
  6. package/dist/commands/branch-command.d.ts.map +1 -1
  7. package/dist/commands/checkout-command.d.ts +7 -24
  8. package/dist/commands/checkout-command.d.ts.map +1 -1
  9. package/dist/commands/clean-command.d.ts +34 -4
  10. package/dist/commands/clean-command.d.ts.map +1 -1
  11. package/dist/commands/clone-command.d.ts +61 -21
  12. package/dist/commands/clone-command.d.ts.map +1 -1
  13. package/dist/commands/core-config.d.ts +16 -0
  14. package/dist/commands/core-config.d.ts.map +1 -0
  15. package/dist/commands/fetch-command.d.ts +104 -37
  16. package/dist/commands/fetch-command.d.ts.map +1 -1
  17. package/dist/commands/index.d.ts +1 -0
  18. package/dist/commands/index.d.ts.map +1 -1
  19. package/dist/commands/index.js +2 -2
  20. package/dist/commands/init-command.d.ts.map +1 -1
  21. package/dist/commands/merge-command.d.ts +15 -2
  22. package/dist/commands/merge-command.d.ts.map +1 -1
  23. package/dist/commands/push-command.d.ts +58 -25
  24. package/dist/commands/push-command.d.ts.map +1 -1
  25. package/dist/commands/remote-command.d.ts +115 -6
  26. package/dist/commands/remote-command.d.ts.map +1 -1
  27. package/dist/commands/reset-command.d.ts.map +1 -1
  28. package/dist/commands/stash-apply-command.d.ts +35 -13
  29. package/dist/commands/stash-apply-command.d.ts.map +1 -1
  30. package/dist/commands/stash-create-command.d.ts +59 -25
  31. package/dist/commands/stash-create-command.d.ts.map +1 -1
  32. package/dist/commands/stash-drop-command.d.ts +8 -2
  33. package/dist/commands/stash-drop-command.d.ts.map +1 -1
  34. package/dist/commands/stash-list-command.d.ts +2 -4
  35. package/dist/commands/stash-list-command.d.ts.map +1 -1
  36. package/dist/commands/stash-working-tree.d.ts +72 -0
  37. package/dist/commands/stash-working-tree.d.ts.map +1 -0
  38. package/dist/commands/status-command.d.ts +29 -22
  39. package/dist/commands/status-command.d.ts.map +1 -1
  40. package/dist/commands/tag-command.d.ts.map +1 -1
  41. package/dist/commands/tree-restore.d.ts +52 -5
  42. package/dist/commands/tree-restore.d.ts.map +1 -1
  43. package/dist/commands/worktree-overwrite-checks.d.ts +64 -0
  44. package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -0
  45. package/dist/{commands-COO4tJhv.js → commands-CsLNyvZ1.js} +3370 -1057
  46. package/dist/core-commands/add.command.impl.d.ts +0 -4
  47. package/dist/core-commands/add.command.impl.d.ts.map +1 -1
  48. package/dist/core-commands/index.d.ts +1 -3
  49. package/dist/core-commands/index.d.ts.map +1 -1
  50. package/dist/core-commands/store-worktree-file.d.ts +6 -0
  51. package/dist/core-commands/store-worktree-file.d.ts.map +1 -0
  52. package/dist/errors/checkout-errors.d.ts +13 -0
  53. package/dist/errors/checkout-errors.d.ts.map +1 -1
  54. package/dist/errors/index.js +18 -1
  55. package/dist/git-command.d.ts +10 -1
  56. package/dist/git-command.d.ts.map +1 -1
  57. package/dist/git.d.ts +21 -3
  58. package/dist/git.d.ts.map +1 -1
  59. package/dist/index.js +4 -4
  60. package/dist/remote-config/index.d.ts +1 -0
  61. package/dist/remote-config/index.d.ts.map +1 -1
  62. package/dist/remote-config/remote-config-store.d.ts +22 -0
  63. package/dist/remote-config/remote-config-store.d.ts.map +1 -1
  64. package/dist/remote-config/remote-refs.d.ts +37 -0
  65. package/dist/remote-config/remote-refs.d.ts.map +1 -0
  66. package/dist/results/clone-result.d.ts +6 -0
  67. package/dist/results/clone-result.d.ts.map +1 -1
  68. package/dist/results/diff-formatter.d.ts +14 -7
  69. package/dist/results/diff-formatter.d.ts.map +1 -1
  70. package/dist/results/fetch-result.d.ts +16 -1
  71. package/dist/results/fetch-result.d.ts.map +1 -1
  72. package/dist/results/index.js +28 -23
  73. package/dist/results/push-result.d.ts +9 -2
  74. package/dist/results/push-result.d.ts.map +1 -1
  75. package/dist/results/status-result.d.ts +91 -20
  76. package/dist/results/status-result.d.ts.map +1 -1
  77. package/dist/{status-result-BwAyxq6R.js → status-result-BpyUK1Sg.js} +115 -5
  78. package/dist/transport-command.d.ts +12 -0
  79. package/dist/transport-command.d.ts.map +1 -1
  80. package/package.json +14 -12
  81. package/src/commands/add-command.ts +23 -30
  82. package/src/commands/blame-command.ts +41 -0
  83. package/src/commands/branch-command.ts +2 -53
  84. package/src/commands/checkout-command.ts +205 -127
  85. package/src/commands/clean-command.ts +187 -81
  86. package/src/commands/clone-command.ts +334 -137
  87. package/src/commands/core-config.ts +41 -0
  88. package/src/commands/fetch-command.ts +536 -211
  89. package/src/commands/gc-command.ts +1 -1
  90. package/src/commands/index.ts +1 -0
  91. package/src/commands/init-command.ts +108 -11
  92. package/src/commands/merge-command.ts +60 -27
  93. package/src/commands/pack-refs-command.ts +2 -2
  94. package/src/commands/push-command.ts +242 -308
  95. package/src/commands/reflog-command.ts +2 -2
  96. package/src/commands/remote-command.ts +429 -19
  97. package/src/commands/reset-command.ts +18 -5
  98. package/src/commands/stash-apply-command.ts +632 -97
  99. package/src/commands/stash-create-command.ts +142 -62
  100. package/src/commands/stash-drop-command.ts +53 -5
  101. package/src/commands/stash-list-command.ts +10 -4
  102. package/src/commands/stash-working-tree.ts +243 -0
  103. package/src/commands/status-command.ts +197 -91
  104. package/src/commands/tag-command.ts +2 -53
  105. package/src/commands/tree-restore.ts +143 -18
  106. package/src/commands/worktree-overwrite-checks.ts +215 -0
  107. package/src/core-commands/add.command.impl.ts +15 -20
  108. package/src/core-commands/index.ts +1 -8
  109. package/src/core-commands/store-worktree-file.ts +5 -0
  110. package/src/errors/checkout-errors.ts +20 -0
  111. package/src/git-command.ts +42 -1
  112. package/src/git.ts +30 -2
  113. package/src/remote-config/index.ts +1 -0
  114. package/src/remote-config/remote-config-store.ts +95 -8
  115. package/src/remote-config/remote-refs.ts +103 -0
  116. package/src/results/clone-result.ts +6 -0
  117. package/src/results/diff-formatter.ts +31 -38
  118. package/src/results/fetch-result.ts +16 -1
  119. package/src/results/push-result.ts +9 -2
  120. package/src/results/status-result.ts +212 -29
  121. package/src/transport-command.ts +18 -0
  122. package/dist/core-commands/checkout.command.d.ts +0 -103
  123. package/dist/core-commands/checkout.command.d.ts.map +0 -1
  124. package/dist/core-commands/checkout.command.impl.d.ts +0 -114
  125. package/dist/core-commands/checkout.command.impl.d.ts.map +0 -1
  126. package/dist/pack-import/index.d.ts +0 -8
  127. package/dist/pack-import/index.d.ts.map +0 -1
  128. package/dist/pack-import/pack-import.d.ts +0 -11
  129. package/dist/pack-import/pack-import.d.ts.map +0 -1
  130. package/src/core-commands/checkout.command.impl.ts +0 -586
  131. package/src/core-commands/checkout.command.ts +0 -125
  132. package/src/pack-import/index.ts +0 -8
  133. package/src/pack-import/pack-import.ts +0 -24
@@ -38,10 +38,6 @@ export declare class AddCommand implements Add {
38
38
  * Add all files in working tree to staging area.
39
39
  */
40
40
  addAll(options?: AddOptions): Promise<AddResult>;
41
- /**
42
- * Store file content as blob and return object ID.
43
- */
44
- private storeFileContent;
45
41
  }
46
42
  /**
47
43
  * Create an AddCommand.
@@ -1 +1 @@
1
- {"version":3,"file":"add.command.impl.d.ts","sourceRoot":"","sources":["../../src/core-commands/add.command.impl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,KAAK,KAAK,EAAY,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAEL,KAAK,OAAO,EAEZ,KAAK,QAAQ,EACd,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEnE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IAEnB,oCAA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AAQ,CAAC,KAAK,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAElC,YAAY,OAAO,EAAE,iBAAiB,EAIrC;IAED;;OAEG;IACG,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,SAAS,CAAC,CAuI9E;IAED;;OAEG;IACG,MAAM,CAAC,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,SAAS,CAAC,CAEzD;CACF;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,GAAG,CAEhE"}
@@ -1,6 +1,4 @@
1
1
  export * from "./add.command.impl.js";
2
2
  export type { Add, AddOptions } from "./add.command.js";
3
- export * from "./checkout.command.impl.js";
4
- export type { Checkout, CheckoutConflict, CheckoutConflictReason, CheckoutOptions, } from "./checkout.command.js";
5
- export { CheckoutConflictReason as CheckoutConflictReasonValues } from "./checkout.command.js";
3
+ export * from "./store-worktree-file.js";
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core-commands/index.ts"],"names":[],"mappings":"AAGA,cAAc,uBAAuB,CAAC;AACtC,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACxD,cAAc,4BAA4B,CAAC;AAC3C,YAAY,EACV,QAAQ,EACR,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,GAChB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,sBAAsB,IAAI,4BAA4B,EAAE,MAAM,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core-commands/index.ts"],"names":[],"mappings":"AAGA,cAAc,uBAAuB,CAAC;AACtC,YAAY,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACxD,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * `storeWorktreeFile` lives in `@statewalker/vcs-working-tree`, so the stash and
3
+ * the add commands share it; re-exported here for existing imports.
4
+ */
5
+ export { storeWorktreeFile } from "@statewalker/vcs-working-tree";
6
+ //# sourceMappingURL=store-worktree-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-worktree-file.d.ts","sourceRoot":"","sources":["../../src/core-commands/store-worktree-file.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { CloneResult } from "../results/index.js";
1
2
  import { GitApiError } from "./git-api-error.js";
2
3
  /**
3
4
  * Thrown when a path is not found in the index during checkout.
@@ -21,4 +22,16 @@ export declare class NotADirectoryError extends GitApiError {
21
22
  readonly path: string;
22
23
  constructor(path: string, message?: string);
23
24
  }
25
+ /**
26
+ * Thrown when a clone fetched its objects and wrote its refs and configuration, but could
27
+ * not check out the commit HEAD names (git: "Clone succeeded, but checkout failed").
28
+ *
29
+ * The repository is usable: `result` is what the clone returns, and the cause says
30
+ * why the checkout failed. As with git, fixing the cause and checking out again (or a
31
+ * `reset --hard`) completes the clone.
32
+ */
33
+ export declare class CloneCheckoutError extends GitApiError {
34
+ readonly result: CloneResult;
35
+ constructor(result: CloneResult, cause: unknown);
36
+ }
24
37
  //# sourceMappingURL=checkout-errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"checkout-errors.d.ts","sourceRoot":"","sources":["../../src/errors/checkout-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,YAAY,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAIzC;CACF;AAED;;GAEG;AACH,qBAAa,uBAAwB,S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,YAAY,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAK9C;CACF"}
@@ -66,6 +66,23 @@ var NotADirectoryError = class extends GitApiError {
66
66
  this.path = path;
67
67
  }
68
68
  };
69
+ /**
70
+ * Thrown when a clone fetched its objects and wrote its refs and configuration, but could
71
+ * not check out the commit HEAD names (git: "Clone succeeded, but checkout failed").
72
+ *
73
+ * The repository is usable: `result` is what the clone returns, and the cause says
74
+ * why the checkout failed. As with git, fixing the cause and checking out again (or a
75
+ * `reset --hard`) completes the clone.
76
+ */
77
+ var CloneCheckoutError = class extends GitApiError {
78
+ result;
79
+ constructor(result, cause) {
80
+ const reason = cause instanceof Error ? cause.message : String(cause);
81
+ super(`Clone succeeded, but checkout failed: ${reason}`, { cause });
82
+ this.name = "CloneCheckoutError";
83
+ this.result = result;
84
+ }
85
+ };
69
86
  //#endregion
70
87
  //#region src/errors/command-errors.ts
71
88
  /**
@@ -506,4 +523,4 @@ var NonFastForwardError = class extends PushRejectedException {
506
523
  }
507
524
  };
508
525
  //#endregion
509
- export { AuthenticationError, CannotDeleteCurrentBranchError, CommitNotFoundError, DetachedHeadError, EmptyCommitError, GitApiError, IncompatibleOptionsError, InvalidArgumentError, InvalidMainlineParentError, InvalidMergeHeadsError, InvalidRefNameError, InvalidRemoteError, InvalidStashIndexError, InvalidTagNameError, MergeConflictError, MergeFailureReason, MissingArgumentError, MultipleParentsNotAllowedError, NoFilepatternError, NoHeadError, NoMergeBaseError, NoMessageError, NoRebaseInProgressError, NonFastForwardError, NotADirectoryError, NotFastForwardError, NotImplementedError, NotMergedError, PathNotFoundInTreeError, PathNotInIndexError, PushRejectedException, RefAlreadyExistsError, RefNotFoundError, RemoteAlreadyExistsError, RemoteNotFoundError, StashApplyFailedError, StashNotFoundError, StoreNotAvailableError, TransportError, UnmergedPathsError, UpstreamRequiredError };
526
+ export { AuthenticationError, CannotDeleteCurrentBranchError, CloneCheckoutError, CommitNotFoundError, DetachedHeadError, EmptyCommitError, GitApiError, IncompatibleOptionsError, InvalidArgumentError, InvalidMainlineParentError, InvalidMergeHeadsError, InvalidRefNameError, InvalidRemoteError, InvalidStashIndexError, InvalidTagNameError, MergeConflictError, MergeFailureReason, MissingArgumentError, MultipleParentsNotAllowedError, NoFilepatternError, NoHeadError, NoMergeBaseError, NoMessageError, NoRebaseInProgressError, NonFastForwardError, NotADirectoryError, NotFastForwardError, NotImplementedError, NotMergedError, PathNotFoundInTreeError, PathNotInIndexError, PushRejectedException, RefAlreadyExistsError, RefNotFoundError, RemoteAlreadyExistsError, RemoteNotFoundError, StashApplyFailedError, StashNotFoundError, StoreNotAvailableError, TransportError, UnmergedPathsError, UpstreamRequiredError };
@@ -1,5 +1,5 @@
1
1
  import type { Blobs, Commit, Commits, ObjectId, Ref, Refs, SymbolicRef, Tag, Tags, Tree, TreeEntry, Trees } from "@statewalker/vcs-core";
2
- import type { Staging, WorkingCopy, Worktree } from "@statewalker/vcs-working-tree";
2
+ import { type Staging, type WorkingCopy, type Worktree } from "@statewalker/vcs-working-tree";
3
3
  /**
4
4
  * Extended Trees interface with legacy method names for command compatibility.
5
5
  */
@@ -49,6 +49,7 @@ export interface CommandCommits extends Commits {
49
49
  export declare abstract class GitCommand<T> {
50
50
  protected readonly _workingCopy: WorkingCopy;
51
51
  private callable;
52
+ private racyCheckInstalled;
52
53
  constructor(workingCopy: WorkingCopy);
53
54
  /**
54
55
  * Access blob storage.
@@ -77,6 +78,14 @@ export declare abstract class GitCommand<T> {
77
78
  * Supports both new architecture (checkout.staging) and legacy/init (staging directly).
78
79
  */
79
80
  protected get staging(): Staging;
81
+ /**
82
+ * Gives the staging git's racy-git smudging for its writes: an entry whose mtime second is
83
+ * not older than the index file and whose content changed behind a matching stat is
84
+ * written with size 0 (`ce_smudge_racily_clean_entry`), so a later same-size edit in that
85
+ * second is never taken as clean.
86
+ */
87
+ private installRacyCheck;
88
+ private resolveStaging;
80
89
  /**
81
90
  * Access worktree interface.
82
91
  */
@@ -1 +1 @@
1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A4ChC;;OAEG;YACW,YAAY;IAwB1B;;;;;OAKG;IACH,UAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,GAAG,WAAW,GAAG,SAAS,CAAC,CAE9E;CACF"}
package/dist/git.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { History } from "@statewalker/vcs-core";
2
2
  import type { Checkout, WorkingCopy, Worktree } from "@statewalker/vcs-working-tree";
3
- import { AddCommand, BlameCommand, CheckoutCommand, CherryPickCommand, CleanCommand, CloneCommand, CommitCommand, CreateBranchCommand, DeleteBranchCommand, DeleteTagCommand, DescribeCommand, DiffCommand, FetchCommand, GarbageCollectCommand, InitCommand, ListBranchCommand, ListTagCommand, LogCommand, LsRemoteCommand, MergeCommand, PackRefsCommand, PullCommand, PushCommand, RebaseCommand, ReflogCommand, RemoteAddCommand, RemoteListCommand, RemoteRemoveCommand, RemoteSetUrlCommand, RenameBranchCommand, ResetCommand, RevertCommand, RmCommand, StashApplyCommand, StashCreateCommand, StashDropCommand, StashListCommand, StatusCommand, TagCommand } from "./commands/index.js";
3
+ import { AddCommand, BlameCommand, CheckoutCommand, CherryPickCommand, CleanCommand, CloneCommand, CommitCommand, CreateBranchCommand, DeleteBranchCommand, DeleteTagCommand, DescribeCommand, DiffCommand, FetchCommand, GarbageCollectCommand, InitCommand, ListBranchCommand, ListTagCommand, LogCommand, LsRemoteCommand, MergeCommand, PackRefsCommand, PullCommand, PushCommand, RebaseCommand, ReflogCommand, RemoteAddCommand, RemoteListCommand, RemoteRemoveCommand, RemoteRenameCommand, RemoteSetHeadCommand, RemoteSetUrlCommand, RenameBranchCommand, ResetCommand, RevertCommand, RmCommand, StashApplyCommand, StashCreateCommand, StashDropCommand, StashListCommand, StatusCommand, TagCommand } from "./commands/index.js";
4
4
  /**
5
5
  * Main entry point for high-level Git operations.
6
6
  *
@@ -365,7 +365,7 @@ export declare class Git implements Disposable {
365
365
  */
366
366
  clean(): CleanCommand;
367
367
  /**
368
- * Create a StatusCommand for showing staging area status.
368
+ * Create a StatusCommand for showing the index and worktree status.
369
369
  *
370
370
  * @example
371
371
  * ```typescript
@@ -487,6 +487,24 @@ export declare class Git implements Disposable {
487
487
  * ```
488
488
  */
489
489
  remoteSetUrl(): RemoteSetUrlCommand;
490
+ /**
491
+ * Create a RemoteSetHeadCommand for setting or deleting `refs/remotes/<name>/HEAD`.
492
+ *
493
+ * @example
494
+ * ```typescript
495
+ * await git.remoteSetHead().setRemoteName("origin").setBranch("develop").call();
496
+ * ```
497
+ */
498
+ remoteSetHead(): RemoteSetHeadCommand;
499
+ /**
500
+ * Create a RemoteRenameCommand for renaming a remote (`git remote rename`).
501
+ *
502
+ * @example
503
+ * ```typescript
504
+ * await git.remoteRename().setOldName("origin").setNewName("upstream").call();
505
+ * ```
506
+ */
507
+ remoteRename(): RemoteRenameCommand;
490
508
  /**
491
509
  * Create a RebaseCommand for rebasing commits.
492
510
  *
@@ -509,8 +527,8 @@ export declare class Git implements Disposable {
509
527
  *
510
528
  * @example
511
529
  * ```typescript
530
+ * // the working copy's index and worktree are stashed, then reset to HEAD
512
531
  * const stashCommit = await git.stashCreate()
513
- * .setWorkingTreeProvider(provider)
514
532
  * .setMessage("WIP: feature work")
515
533
  * .call();
516
534
  * ```
package/dist/git.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAErF,OAAO,EACL,UAAU,EACV,YAAY,EACZ,eAAe,EACf,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,YAAY,EACZ,qBAAqB,EACrB,WAAW,EACX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UG;IACH,WAAW,IAAI,kBAAkB,CAGhC;IAED;;;;;;;;;;;;;OAaG;IACH,UAAU,IAAI,iBAAiB,CAG9B;IAED;;;;;;;;;;;OAWG;IACH,SAAS,IAAI,gBAAgB,CAG5B;IAED;;;;;;;;;;OAUG;IACH,SAAS,IAAI,gBAAgB,CAG5B;IAID;;;;;;;;;;;;OAYG;IACH,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED;;;;;;;;;;;;;;OAcG;IACH,IAAI,OAAO,IAAI,OAAO,GAAG,SAAS,CAEjC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,aAAa,IAAI,QAAQ,GAAG,SAAS,CAExC;IAED;;;;;;;;;;;;;;;OAeG;IACH,IAAI,QAAQ,IAAI,QAAQ,GAAG,SAAS,CAEnC;IAID;;;;;OAKG;IACH,KAAK,IAAI,IAAI,CAEZ;IAED;;OAEG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,IAAI,CAEvB;IAID,OAAO,CAAC,WAAW;CAKpB"}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import { AuthenticationError, CannotDeleteCurrentBranchError, CommitNotFoundError, DetachedHeadError, EmptyCommitError, GitApiError, IncompatibleOptionsError, InvalidArgumentError, InvalidMainlineParentError, InvalidMergeHeadsError, InvalidRefNameError, InvalidRemoteError, InvalidStashIndexError, InvalidTagNameError, MergeConflictError, MergeFailureReason, MissingArgumentError, MultipleParentsNotAllowedError, NoFilepatternError, NoHeadError, NoMergeBaseError, NoMessageError, NoRebaseInProgressError, NonFastForwardError, NotADirectoryError, NotFastForwardError, NotImplementedError, NotMergedError, PathNotFoundInTreeError, PathNotInIndexError, PushRejectedException, RefAlreadyExistsError, RefNotFoundError, RemoteAlreadyExistsError, RemoteNotFoundError, StashApplyFailedError, StashNotFoundError, StoreNotAvailableError, TransportError, UnmergedPathsError, UpstreamRequiredError } from "./errors/index.js";
2
- import { A as DiffCommand, B as CheckoutCommand, C as MergeCommand, D as InitCommand, E as RevFilter, F as FetchCommand, G as ListBranchCommand, H as CheckoutStatus, I as TagOption, J as ResetMode, K as RenameBranchCommand, L as TransportCommand, M as DescribeCommand, N as CommitCommand, O as Git, P as CloneCommand, R as CleanCommand, S as PackRefsCommand, T as LogCommand, U as CreateBranchCommand, V as CheckoutStage, W as DeleteBranchCommand, X as AddCommand, Y as BlameCommand, Z as GitCommand, _ as ReflogCommand, a as StashDropCommand, b as PushCommand, c as STASH_REF, d as RevertCommand, f as ResetCommand, g as RemoteSetUrlCommand, h as RemoteRemoveCommand, i as StatusCommand, j as formatDiffEntry, k as GarbageCollectCommand, l as StashListCommand, m as RemoteListCommand, n as ListTagCommand, o as StashCreateCommand, p as RemoteAddCommand, q as ListBranchMode, r as TagCommand, s as StashApplyCommand, t as DeleteTagCommand, u as RmCommand, v as RebaseCommand, w as LsRemoteCommand, x as PullCommand, y as RebaseOperation, z as CherryPickCommand } from "./commands-COO4tJhv.js";
3
- import { C as isMergeSuccessful, S as MergeStrategy, _ as getSuccessfulUpdates, a as RebaseStatus, b as FastForwardMode, c as getFailedUpdates, d as createAddEntry, f as createCopyEntry, g as RefUpdateStatus, h as createRenameEntry, i as RebaseAction, l as isPushSuccessful, m as createModifyEntry, n as StashApplyStatus, o as isRebaseSuccessful, p as createDeleteEntry, r as RevertStatus, s as PushStatus, t as StatusImpl, u as ChangeType, v as hasUpdates, w as CherryPickStatus, x as MergeStatus, y as ContentMergeStrategy } from "./status-result-BwAyxq6R.js";
1
+ import { $ as ResetMode, A as InitCommand, B as toTagMode, C as PushCommand, D as LsRemoteCommand, E as MergeCommand, F as DescribeCommand, G as CheckoutCommand, H as TransportCommand, I as CommitCommand, J as CreateBranchCommand, K as CheckoutStage, L as CloneCommand, M as GarbageCollectCommand, N as DiffCommand, O as LogCommand, P as formatDiffEntry, Q as ListBranchMode, R as FetchCommand, S as RebaseOperation, T as PackRefsCommand, U as CleanCommand, V as toTrackingRefUpdate, W as CherryPickCommand, X as ListBranchCommand, Y as DeleteBranchCommand, Z as RenameBranchCommand, _ as RemoteRenameCommand, a as StashDropCommand, b as ReflogCommand, c as StashApplyCommand, d as RmCommand, et as BlameCommand, f as RevertCommand, g as RemoteRemoveCommand, h as RemoteListCommand, i as StatusCommand, j as Git, k as RevFilter, l as STASH_REF, m as RemoteAddCommand, n as ListTagCommand, nt as GitCommand, o as StashCreateCommand, p as ResetCommand, q as CheckoutStatus, r as TagCommand, s as WorkingCopyStashProvider, t as DeleteTagCommand, tt as AddCommand, u as StashListCommand, v as RemoteSetHeadCommand, w as PullCommand, x as RebaseCommand, y as RemoteSetUrlCommand, z as TagOption } from "./commands-CsLNyvZ1.js";
2
+ import { AuthenticationError, CannotDeleteCurrentBranchError, CloneCheckoutError, CommitNotFoundError, DetachedHeadError, EmptyCommitError, GitApiError, IncompatibleOptionsError, InvalidArgumentError, InvalidMainlineParentError, InvalidMergeHeadsError, InvalidRefNameError, InvalidRemoteError, InvalidStashIndexError, InvalidTagNameError, MergeConflictError, MergeFailureReason, MissingArgumentError, MultipleParentsNotAllowedError, NoFilepatternError, NoHeadError, NoMergeBaseError, NoMessageError, NoRebaseInProgressError, NonFastForwardError, NotADirectoryError, NotFastForwardError, NotImplementedError, NotMergedError, PathNotFoundInTreeError, PathNotInIndexError, PushRejectedException, RefAlreadyExistsError, RefNotFoundError, RemoteAlreadyExistsError, RemoteNotFoundError, StashApplyFailedError, StashNotFoundError, StoreNotAvailableError, TransportError, UnmergedPathsError, UpstreamRequiredError } from "./errors/index.js";
3
+ import { C as MergeStrategy, S as MergeStatus, T as CherryPickStatus, _ as RefUpdateStatus, a as RebaseAction, b as ContentMergeStrategy, c as PushStatus, d as ChangeType, f as createAddEntry, g as createRenameEntry, h as createModifyEntry, i as RevertStatus, l as getFailedUpdates, m as createDeleteEntry, n as formatStatusPorcelain, o as RebaseStatus, p as createCopyEntry, r as StashApplyStatus, s as isRebaseSuccessful, t as StatusImpl, u as isPushSuccessful, v as getSuccessfulUpdates, w as isMergeSuccessful, x as FastForwardMode, y as hasUpdates } from "./status-result-BpyUK1Sg.js";
4
4
  import { DiffFormatter, isPullSuccessful } from "./results/index.js";
5
- export { AddCommand, AuthenticationError, BlameCommand, CannotDeleteCurrentBranchError, ChangeType, CheckoutCommand, CheckoutStage, CheckoutStatus, CherryPickCommand, CherryPickStatus, CleanCommand, CloneCommand, CommitCommand, CommitNotFoundError, ContentMergeStrategy, CreateBranchCommand, DeleteBranchCommand, DeleteTagCommand, DescribeCommand, DetachedHeadError, DiffCommand, DiffFormatter, EmptyCommitError, FastForwardMode, FetchCommand, GarbageCollectCommand, Git, GitApiError, GitCommand, IncompatibleOptionsError, InitCommand, InvalidArgumentError, InvalidMainlineParentError, InvalidMergeHeadsError, InvalidRefNameError, InvalidRemoteError, InvalidStashIndexError, InvalidTagNameError, ListBranchCommand, ListBranchMode, ListTagCommand, LogCommand, LsRemoteCommand, MergeCommand, MergeConflictError, MergeFailureReason, MergeStatus, MergeStrategy, MissingArgumentError, MultipleParentsNotAllowedError, NoFilepatternError, NoHeadError, NoMergeBaseError, NoMessageError, NoRebaseInProgressError, NonFastForwardError, NotADirectoryError, NotFastForwardError, NotImplementedError, NotMergedError, PackRefsCommand, PathNotFoundInTreeError, PathNotInIndexError, PullCommand, PushCommand, PushRejectedException, PushStatus, RebaseAction, RebaseCommand, RebaseOperation, RebaseStatus, RefAlreadyExistsError, RefNotFoundError, RefUpdateStatus, ReflogCommand, RemoteAddCommand, RemoteAlreadyExistsError, RemoteListCommand, RemoteNotFoundError, RemoteRemoveCommand, RemoteSetUrlCommand, RenameBranchCommand, ResetCommand, ResetMode, RevFilter, RevertCommand, RevertStatus, RmCommand, STASH_REF, StashApplyCommand, StashApplyFailedError, StashApplyStatus, StashCreateCommand, StashDropCommand, StashListCommand, StashNotFoundError, StatusCommand, StatusImpl, StoreNotAvailableError, TagCommand, TagOption, TransportCommand, TransportError, UnmergedPathsError, UpstreamRequiredError, createAddEntry, createCopyEntry, createDeleteEntry, createModifyEntry, createRenameEntry, formatDiffEntry, getFailedUpdates, getSuccessfulUpdates, hasUpdates, isMergeSuccessful, isPullSuccessful, isPushSuccessful, isRebaseSuccessful };
5
+ export { AddCommand, AuthenticationError, BlameCommand, CannotDeleteCurrentBranchError, ChangeType, CheckoutCommand, CheckoutStage, CheckoutStatus, CherryPickCommand, CherryPickStatus, CleanCommand, CloneCheckoutError, CloneCommand, CommitCommand, CommitNotFoundError, ContentMergeStrategy, CreateBranchCommand, DeleteBranchCommand, DeleteTagCommand, DescribeCommand, DetachedHeadError, DiffCommand, DiffFormatter, EmptyCommitError, FastForwardMode, FetchCommand, GarbageCollectCommand, Git, GitApiError, GitCommand, IncompatibleOptionsError, InitCommand, InvalidArgumentError, InvalidMainlineParentError, InvalidMergeHeadsError, InvalidRefNameError, InvalidRemoteError, InvalidStashIndexError, InvalidTagNameError, ListBranchCommand, ListBranchMode, ListTagCommand, LogCommand, LsRemoteCommand, MergeCommand, MergeConflictError, MergeFailureReason, MergeStatus, MergeStrategy, MissingArgumentError, MultipleParentsNotAllowedError, NoFilepatternError, NoHeadError, NoMergeBaseError, NoMessageError, NoRebaseInProgressError, NonFastForwardError, NotADirectoryError, NotFastForwardError, NotImplementedError, NotMergedError, PackRefsCommand, PathNotFoundInTreeError, PathNotInIndexError, PullCommand, PushCommand, PushRejectedException, PushStatus, RebaseAction, RebaseCommand, RebaseOperation, RebaseStatus, RefAlreadyExistsError, RefNotFoundError, RefUpdateStatus, ReflogCommand, RemoteAddCommand, RemoteAlreadyExistsError, RemoteListCommand, RemoteNotFoundError, RemoteRemoveCommand, RemoteRenameCommand, RemoteSetHeadCommand, RemoteSetUrlCommand, RenameBranchCommand, ResetCommand, ResetMode, RevFilter, RevertCommand, RevertStatus, RmCommand, STASH_REF, StashApplyCommand, StashApplyFailedError, StashApplyStatus, StashCreateCommand, StashDropCommand, StashListCommand, StashNotFoundError, StatusCommand, StatusImpl, StoreNotAvailableError, TagCommand, TagOption, TransportCommand, TransportError, UnmergedPathsError, UpstreamRequiredError, WorkingCopyStashProvider, createAddEntry, createCopyEntry, createDeleteEntry, createModifyEntry, createRenameEntry, formatDiffEntry, formatStatusPorcelain, getFailedUpdates, getSuccessfulUpdates, hasUpdates, isMergeSuccessful, isPullSuccessful, isPushSuccessful, isRebaseSuccessful, toTagMode, toTrackingRefUpdate };
@@ -4,4 +4,5 @@
4
4
  * Internal: not re-exported from `src/index.ts`.
5
5
  */
6
6
  export { defaultFetchRefspec, listRemoteNames, type RemoteConfig, RemoteConfigStore, } from "./remote-config-store.js";
7
+ export { deleteRefs, moveRefs, type RefMove } from "./remote-refs.js";
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/remote-config/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,KAAK,YAAY,EACjB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/remote-config/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,KAAK,YAAY,EACjB,iBAAiB,GAClB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,OAAO,EAAE,MAAM,kBAAkB,CAAC"}
@@ -53,10 +53,24 @@ export declare class RemoteConfigStore {
53
53
  * configured, exactly as `git remote` reports one.
54
54
  */
55
55
  read(name: string): RemoteConfig;
56
+ /**
57
+ * The `remote.<name>.fetch` lines as configured, without the default {@link read} fills
58
+ * in: a remote without any fetches only its HEAD, as `git fetch <name>` does.
59
+ */
60
+ configuredFetchRefspecs(name: string): string[];
56
61
  /** Write every field of a remote, replacing whatever was there. */
57
62
  write(remote: RemoteConfig): void;
58
63
  /** Drop the whole `[remote "<name>"]` section. */
59
64
  remove(name: string): void;
65
+ /**
66
+ * Rename the `[remote "<oldName>"]` section to `[remote "<newName>"]`, in place where the
67
+ * config can (git's rename_section), else by copying every `remote.<oldName>.*` variable.
68
+ */
69
+ rename(oldName: string, newName: string): void;
70
+ /** Subsection names of a section (`branch`: the branch names with configuration). */
71
+ subsections(section: string): string[];
72
+ /** Remove every value of a config variable. */
73
+ unset(key: string): void;
60
74
  /**
61
75
  * Point a remote at a URL.
62
76
  *
@@ -76,6 +90,14 @@ export declare class RemoteConfigStore {
76
90
  urlFor(name: string, options?: {
77
91
  push?: boolean;
78
92
  }): string | undefined;
93
+ /** A config variable (`push.default`, `branch.main.merge`), the last value when repeated. */
94
+ value(key: string): string | undefined;
95
+ /** Every value of a config variable (`branch.main.merge` may repeat). */
96
+ values(key: string): string[];
97
+ /** Sets a config variable, replacing every value it had. */
98
+ setValue(key: string, value: string): void;
99
+ /** Sets every value of a config variable, in order (none: unset). */
100
+ setValues(key: string, values: string[]): void;
79
101
  /** Flush to the backing file, if the config has one. */
80
102
  save(): Promise<void>;
81
103
  private strings;
@@ -1 +1 @@
1
- {"version":3,"file":"remote-config-store.d.ts","sourceRoot":"","sources":["../../src/remote-config/remote-config-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAqB,MAAM,+BAA+B,CAAC;AAIpF;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC3B,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB;IACjB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,oDAAoD;IACpD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,qBAAqB;IACrB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,oBAAoB;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExD;AAmHD;;;;;;;GAOG;AACH,qBAAa,iBAAiB;IACR,OAAO,CAAC,QAAQ,CAAC,MAAM;IAA3C,OAAO,eAAuD;IAE9D;;;;;OAKG;IACH,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,iBAAiB,CAIvD;IAED,+CAA+C;IAC/C,eAAe,IAAI,MAAM,EAAE,CAE1B;IAED,+CAA+C;IAC/C,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElC;IAED;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAS/B;IAED,mEAAmE;IACnE,KAAK,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAKhC;IAED,kDAAkD;IAClD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAEzB;IAED;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,IAAI,CAezF;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,MAAM,GAAG,SAAS,CAMzE;IAED,wDAAwD;IAClD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE1B;IAED,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,MAAM;CASf;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE;IAAE,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GAC9D,OAAO,CAAC,MAAM,EAAE,CAAC,CAOnB"}
1
+ {"version":3,"file":"remote-config-store.d.ts","sourceRoot":"","sources":["../../src/remote-config/remote-config-store.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,O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,CAEvB;IAED;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,IAAI,CAezF;IAED;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,MAAM,GAAG,SAAS,CAMzE;IAED,6FAA6F;IAC7F,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAGrC;IAED,yEAAyE;IACzE,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAK5B;IAED,4DAA4D;IAC5D,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAEzC;IAED,qEAAqE;IACrE,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAO7C;IAED,wDAAwD;IAClD,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE1B;IAED,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,MAAM;CASf;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE;IAAE,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,GAC9D,OAAO,CAAC,MAAM,EAAE,CAAC,CAOnB"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Multi-ref writes of the remote commands (`git remote remove`, `git remote rename`,
3
+ * `git fetch --prune`), as one ref batch where the store can apply it.
4
+ *
5
+ * Internal to the package.
6
+ */
7
+ import { type OwnReflogLine, type Refs } from "@statewalker/vcs-core";
8
+ /** One ref of a {@link moveRefs}: where it goes and the reflog it takes along. */
9
+ export interface RefMove {
10
+ from: string;
11
+ to: string;
12
+ /** The reflog lines of the new name, oldest first (git carries the old log over) */
13
+ reflog?: OwnReflogLine[];
14
+ }
15
+ /**
16
+ * Deletes `names` with their reflogs: the refs holding an object id in one atomic batch
17
+ * (logged `message` where the store logs deletes), symbolic refs themselves (not their
18
+ * targets) one by one, as git deletes with REF_NO_DEREF. A store that cannot batch several
19
+ * refs (`unsupported`) deletes them one by one.
20
+ *
21
+ * @throws Error naming the refs when the batch is refused (nothing deleted then)
22
+ */
23
+ export declare function deleteRefs(refs: Refs, names: string[], message: string): Promise<void>;
24
+ /**
25
+ * Renames refs, as `git remote rename` moves `refs/remotes/<old>/*`: the refs holding an
26
+ * object id are deleted and created under their new names in one atomic batch, each new
27
+ * name with the reflog lines given (the old log, carried over); symbolic refs are then
28
+ * re-created under their new names pointing at `symbolicTarget(old target)`. A store whose
29
+ * batch refuses several refs (`unsupported`: vcs-core's interim `kvStoreRefs`, which keeps
30
+ * no reflogs) moves them one by one: each new name is created only if it does not exist
31
+ * (compare-and-swap) before the old one goes, so no ref is overwritten or lost.
32
+ *
33
+ * @throws Error naming the refs when the batch is refused (a name conflict: nothing moved),
34
+ * or naming the ref whose new name exists in the one-by-one move (the refs before it moved)
35
+ */
36
+ export declare function moveRefs(refs: Refs, moves: RefMove[], symbolicTarget: (target: string) => string): Promise<void>;
37
+ //# sourceMappingURL=remote-refs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-refs.d.ts","sourceRoot":"","sources":["../../src/remote-config/remote-refs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAiB,KAAK,aAAa,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAErF,kFAAkF;AAClF,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,oFAAoF;IACpF,MAAM,CAAC,EAAE,aAAa,EAAE,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAmB5F;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,QAAQ,CAC5B,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,OAAO,EAAE,EAChB,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,GACzC,OAAO,CAAC,IAAI,CAAC,CAmCf"}
@@ -20,5 +20,11 @@ export interface CloneResult {
20
20
  bare: boolean;
21
21
  /** Head commit after clone */
22
22
  headCommit?: ObjectId;
23
+ /**
24
+ * Files of the checked-out tree whose paths differ only in case (`README`, `readme`),
25
+ * on a worktree that folds case (`core.ignorecase`): only one of each group is in the
26
+ * worktree, as with git's "the following paths have collided" warning.
27
+ */
28
+ collidedPaths?: string[];
23
29
  }
24
30
  //# sourceMappingURL=clone-result.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"clone-result.d.ts","sourceRoot":"","sources":["../../src/results/clone-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,WAAW,EAAE,WAAW,CAAC;IACzB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,8BAA8B;IAC9B,UAAU,CAAC,EAAE,QAAQ,CAAC;CACvB"}
1
+ {"version":3,"file":"clone-result.d.ts","sourceRoot":"","sources":["../../src/results/clone-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,qDAAqD;IACrD,WAAW,EAAE,WAAW,CAAC;IACzB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,IAAI,EAAE,OAAO,CAAC;IACd,8BAA8B;IAC9B,UAAU,CAAC,EAAE,QAAQ,CAAC;IACtB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B"}
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * Based on JGit's DiffFormatter class.
5
5
  */
6
- import type { Blobs } from "@statewalker/vcs-core";
6
+ import { type Blobs } from "@statewalker/vcs-core";
7
7
  import { type SupportedAlgorithm } from "@statewalker/vcs-utils";
8
8
  import { type DiffEntry } from "./diff-entry.js";
9
9
  /**
@@ -20,6 +20,11 @@ export interface DiffFormatterOptions {
20
20
  abbreviationLength?: number;
21
21
  /** Diff algorithm to use (default: histogram) */
22
22
  algorithm?: SupportedAlgorithm;
23
+ /**
24
+ * Files larger than this are binary: they show as "Binary files differ" and are
25
+ * never loaded (git's `core.bigFileThreshold`). Default 50 MiB.
26
+ */
27
+ bigFileThreshold?: number;
23
28
  }
24
29
  /**
25
30
  * A hunk in unified diff format.
@@ -54,9 +59,9 @@ export interface FileContentDiff {
54
59
  indexLine?: string;
55
60
  /** Hunks of changes */
56
61
  hunks: DiffHunk[];
57
- /** Raw old content (for binary display or further processing) */
62
+ /** Raw old content of a text file (binary files are not loaded) */
58
63
  oldContent?: Uint8Array;
59
- /** Raw new content (for binary display or further processing) */
64
+ /** Raw new content of a text file (binary files are not loaded) */
60
65
  newContent?: Uint8Array;
61
66
  }
62
67
  /**
@@ -83,10 +88,16 @@ export declare class DiffFormatter {
83
88
  private abbreviateIds;
84
89
  private abbreviationLength;
85
90
  private diffAlgorithm;
91
+ private bigFileThreshold;
86
92
  constructor(blobs: Blobs, options?: DiffFormatterOptions);
87
93
  /**
88
94
  * Format a DiffEntry into a content diff.
89
95
  *
96
+ * Each side is probed first (its size, and a NUL byte in its first 8000
97
+ * bytes, as git checks). A side over `bigFileThreshold` or binary makes the
98
+ * entry binary, and then the other side is not loaded. Text sides are loaded
99
+ * whole, as the diff algorithms need them, by the same single read as the probe.
100
+ *
90
101
  * @param entry The diff entry to format
91
102
  * @returns Content diff with hunks
92
103
  */
@@ -105,10 +116,6 @@ export declare class DiffFormatter {
105
116
  * @returns Complete unified diff output
106
117
  */
107
118
  formatAll(entries: DiffEntry[]): Promise<string>;
108
- /**
109
- * Load blob content from storage.
110
- */
111
- private loadContent;
112
119
  /**
113
120
  * Build the diff header line.
114
121
  */
@@ -1 +1 @@
1
- {"version":3,"file":"diff-formatter.d.ts","sourceRoot":"","sources":["../../src/results/diff-formatter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAY,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAOL,KAAK,kBAAkB,EACxB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAc,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE7D;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sDAAsD;IACtD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,uDAAuD;IACvD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oDAAoD;IACpD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iDAAiD;IACjD,SAAS,CAAC,EAAE,kBAAkB,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,0CAA0C;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,QAAQ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BAAkB;IAO1B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAO1B;;OAEG;IACH,OAAO,CAAC,YAAY;IAOpB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;OAEG;IACH,OAAO,CAAC,WAAW;IAgBnB;;OAEG;IACH,OAAO,CAAC,YAAY;IAkCpB;;OAEG;IACH,OAAO,CAAC,UAAU;CAoDnB"}
@@ -15,6 +15,13 @@ export interface TrackingRefUpdate {
15
15
  newObjectId: ObjectId;
16
16
  /** Update result status */
17
17
  status: RefUpdateStatus;
18
+ /**
19
+ * How git prints the update: `[new branch]`, `[new tag]`, `abc1234..def5678` (fast-forward),
20
+ * `+ abc1234...def5678` (forced), `[rejected]`, `[up to date]`
21
+ */
22
+ summary?: string;
23
+ /** Why a ref was rejected (`non-fast-forward`, `would clobber existing tag`, a lock failure) */
24
+ reason?: string;
18
25
  }
19
26
  /**
20
27
  * Status of a ref update.
@@ -62,8 +69,16 @@ export interface FetchResult {
62
69
  bytesReceived: number;
63
70
  /** Whether the remote repository was empty */
64
71
  isEmpty: boolean;
65
- /** Messages from the remote */
72
+ /**
73
+ * Messages as git prints them: the `followRemoteHEAD=warn` warning and its hint lines,
74
+ * the symbolic refs a prune left dangling
75
+ */
66
76
  messages: string[];
77
+ /**
78
+ * What failed without stopping the fetch (a refused prune), where git reports an error
79
+ * and exits 1; absent when nothing failed
80
+ */
81
+ errors?: string[];
67
82
  /** Submodule fetch results (if any) */
68
83
  submodules?: Map<string, FetchResult>;
69
84
  }
@@ -1 +1 @@
1
- {"version":3,"file":"fetch-result.d.ts","sourceRoot":"","sources":["../../src/results/fetch-result.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,sCAAsC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,oCAA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E,WAAW,CAAC,CAAC;CACvC;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAEvD;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,iBAAiB,EAAE,CAO7E"}
@@ -1,7 +1,13 @@
1
- import { C as isMergeSuccessful, S as MergeStrategy, _ as getSuccessfulUpdates, a as RebaseStatus, b as FastForwardMode, c as getFailedUpdates, d as createAddEntry, f as createCopyEntry, g as RefUpdateStatus, h as createRenameEntry, i as RebaseAction, l as isPushSuccessful, m as createModifyEntry, n as StashApplyStatus, o as isRebaseSuccessful, p as createDeleteEntry, r as RevertStatus, s as PushStatus, t as StatusImpl, u as ChangeType, v as hasUpdates, w as CherryPickStatus, x as MergeStatus, y as ContentMergeStrategy } from "../status-result-BwAyxq6R.js";
1
+ import { C as MergeStrategy, S as MergeStatus, T as CherryPickStatus, _ as RefUpdateStatus, a as RebaseAction, b as ContentMergeStrategy, c as PushStatus, d as ChangeType, f as createAddEntry, g as createRenameEntry, h as createModifyEntry, i as RevertStatus, l as getFailedUpdates, m as createDeleteEntry, n as formatStatusPorcelain, o as RebaseStatus, p as createCopyEntry, r as StashApplyStatus, s as isRebaseSuccessful, t as StatusImpl, u as isPushSuccessful, v as getSuccessfulUpdates, w as isMergeSuccessful, x as FastForwardMode, y as hasUpdates } from "../status-result-BpyUK1Sg.js";
2
+ import { DEFAULT_BIG_FILE_THRESHOLD, probeBlob } from "@statewalker/vcs-core";
2
3
  import { DEFAULT_ALGORITHM, RawText, RawTextComparator, getAlgorithm } from "@statewalker/vcs-utils";
3
4
  //#region src/results/diff-formatter.ts
4
5
  /**
6
+ * Formatter for generating unified diff output from DiffEntry objects.
7
+ *
8
+ * Based on JGit's DiffFormatter class.
9
+ */
10
+ /**
5
11
  * Format DiffEntry objects into unified diff format.
6
12
  *
7
13
  * @example
@@ -25,6 +31,7 @@ var DiffFormatter = class {
25
31
  abbreviateIds;
26
32
  abbreviationLength;
27
33
  diffAlgorithm;
34
+ bigFileThreshold;
28
35
  constructor(blobs, options = {}) {
29
36
  this.blobs = blobs;
30
37
  this.contextLines = options.contextLines ?? 3;
@@ -32,17 +39,29 @@ var DiffFormatter = class {
32
39
  this.abbreviateIds = options.abbreviateIds ?? true;
33
40
  this.abbreviationLength = options.abbreviationLength ?? 7;
34
41
  this.diffAlgorithm = getAlgorithm(options.algorithm ?? DEFAULT_ALGORITHM);
42
+ this.bigFileThreshold = options.bigFileThreshold ?? DEFAULT_BIG_FILE_THRESHOLD;
35
43
  }
36
44
  /**
37
45
  * Format a DiffEntry into a content diff.
38
46
  *
47
+ * Each side is probed first (its size, and a NUL byte in its first 8000
48
+ * bytes, as git checks). A side over `bigFileThreshold` or binary makes the
49
+ * entry binary, and then the other side is not loaded. Text sides are loaded
50
+ * whole, as the diff algorithms need them, by the same single read as the probe.
51
+ *
39
52
  * @param entry The diff entry to format
40
53
  * @returns Content diff with hunks
41
54
  */
42
55
  async format(entry) {
43
- const oldContent = entry.oldId ? await this.loadContent(entry.oldId) : null;
44
- const newContent = entry.newId ? await this.loadContent(entry.newId) : null;
45
- const isBinary = oldContent !== null && RawText.isBinary(oldContent) || newContent !== null && RawText.isBinary(newContent);
56
+ const options = {
57
+ bigFileThreshold: this.bigFileThreshold,
58
+ loadText: true
59
+ };
60
+ const oldProbe = entry.oldId ? await probeBlob(this.blobs, entry.oldId, options) : null;
61
+ const newProbe = !oldProbe?.binary && entry.newId ? await probeBlob(this.blobs, entry.newId, options) : null;
62
+ const isBinary = (oldProbe?.binary ?? false) || (newProbe?.binary ?? false);
63
+ const oldContent = !isBinary ? oldProbe?.content ?? null : null;
64
+ const newContent = !isBinary ? newProbe?.content ?? null : null;
46
65
  const result = {
47
66
  entry,
48
67
  isBinary,
@@ -76,7 +95,10 @@ var DiffFormatter = class {
76
95
  if (diff.indexLine) lines.push(diff.indexLine);
77
96
  }
78
97
  if (diff.isBinary) {
79
- lines.push(`Binary files ${diff.entry.oldPath ?? "/dev/null"} and ${diff.entry.newPath ?? "/dev/null"} differ`);
98
+ const e = diff.entry;
99
+ const oldName = e.changeType === "ADD" || !e.oldPath ? "/dev/null" : `a/${e.oldPath}`;
100
+ const newName = e.changeType === "DELETE" || !e.newPath ? "/dev/null" : `b/${e.newPath}`;
101
+ lines.push(`Binary files ${oldName} and ${newName} differ`);
80
102
  return lines.join("\n");
81
103
  }
82
104
  if (this.includeHeaders && diff.hunks.length > 0) {
@@ -104,23 +126,6 @@ var DiffFormatter = class {
104
126
  return parts.join("\n");
105
127
  }
106
128
  /**
107
- * Load blob content from storage.
108
- */
109
- async loadContent(objectId) {
110
- const content = await this.blobs.load(objectId);
111
- if (!content) throw new Error(`Blob not found: ${objectId}`);
112
- const chunks = [];
113
- for await (const chunk of content) chunks.push(chunk);
114
- const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
115
- const result = new Uint8Array(totalLength);
116
- let offset = 0;
117
- for (const chunk of chunks) {
118
- result.set(chunk, offset);
119
- offset += chunk.length;
120
- }
121
- return result;
122
- }
123
- /**
124
129
  * Build the diff header line.
125
130
  */
126
131
  buildHeader(entry) {
@@ -244,4 +249,4 @@ function isPullSuccessful(result) {
244
249
  return result.successful;
245
250
  }
246
251
  //#endregion
247
- export { ChangeType, CherryPickStatus, ContentMergeStrategy, DiffFormatter, FastForwardMode, MergeStatus, MergeStrategy, PushStatus, RebaseAction, RebaseStatus, RefUpdateStatus, RevertStatus, StashApplyStatus, StatusImpl, createAddEntry, createCopyEntry, createDeleteEntry, createModifyEntry, createRenameEntry, getFailedUpdates, getSuccessfulUpdates, hasUpdates, isMergeSuccessful, isPullSuccessful, isPushSuccessful, isRebaseSuccessful };
252
+ export { ChangeType, CherryPickStatus, ContentMergeStrategy, DiffFormatter, FastForwardMode, MergeStatus, MergeStrategy, PushStatus, RebaseAction, RebaseStatus, RefUpdateStatus, RevertStatus, StashApplyStatus, StatusImpl, createAddEntry, createCopyEntry, createDeleteEntry, createModifyEntry, createRenameEntry, formatStatusPorcelain, getFailedUpdates, getSuccessfulUpdates, hasUpdates, isMergeSuccessful, isPullSuccessful, isPushSuccessful, isRebaseSuccessful };
@@ -9,6 +9,8 @@ export declare enum PushStatus {
9
9
  OK = "ok",
10
10
  /** Update was rejected (not fast-forward) */
11
11
  REJECTED_NONFASTFORWARD = "rejected-nonfastforward",
12
+ /** Update was rejected: the remote ref no longer has the leased value (`--force-with-lease`) */
13
+ REJECTED_REMOTE_CHANGED = "rejected-remote-changed",
12
14
  /** Update was rejected (other reason) */
13
15
  REJECTED_OTHER = "rejected-other",
14
16
  /** Update failed (remote error) */
@@ -36,9 +38,14 @@ export interface RemoteRefUpdate {
36
38
  newObjectId: ObjectId;
37
39
  /** Status of the update */
38
40
  status: PushStatus;
39
- /** Message from server (if any) */
41
+ /** Why the update was refused: the server's reason, or git's status column */
40
42
  message?: string;
41
- /** Whether this was a forced update */
43
+ /**
44
+ * git's status column (`[new branch]`, `abc1234..def5678`, `[rejected] (fetch first)`,
45
+ * `[remote rejected] (hook declined)`, …)
46
+ */
47
+ summary?: string;
48
+ /** Whether the update was allowed to be a non-fast-forward (`+`, setForce, a lease that held) */
42
49
  forceUpdate: boolean;
43
50
  /** Whether this was a delete operation */
44
51
  delete: boolean;