es-git 0.3.0-next.129 → 0.3.0-next.130

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 (3) hide show
  1. package/index.d.ts +148 -0
  2. package/index.js +2 -1
  3. package/package.json +11 -11
package/index.d.ts CHANGED
@@ -1715,6 +1715,45 @@ export interface CreateLightweightTagOptions {
1715
1715
  * - `PostOrder` : Runs the traversal in post-order.
1716
1716
  */
1717
1717
  export type TreeWalkMode = 'PreOrder' | 'PostOrder';
1718
+ /**
1719
+ * A structure to represent an annotated commit, the input to merge and rebase.
1720
+ *
1721
+ * An annotated commit contains information about how it was looked up, which
1722
+ * may be useful for functions like merge or rebase to provide context to the
1723
+ * operation.
1724
+ */
1725
+ export declare class AnnotatedCommit {
1726
+ /**
1727
+ * Gets the commit ID that the given Annotated Commit refers to.
1728
+ *
1729
+ * @category AnnotatedCommit/Methods
1730
+ * @signature
1731
+ * ```ts
1732
+ * class AnnotatedCommit {
1733
+ * id(): string;
1734
+ * }
1735
+ * ```
1736
+ *
1737
+ * @returns The commit ID that this Annotated Commit refers to.
1738
+ */
1739
+ id(): string
1740
+ /**
1741
+ * Get the refname that the given Annotated Commit refers to.
1742
+ *
1743
+ * @category AnnotatedCommit/Methods
1744
+ * @signature
1745
+ * ```ts
1746
+ * class AnnotatedCommit {
1747
+ * refname(): string | null;
1748
+ * }
1749
+ * ```
1750
+ *
1751
+ * @returns The refname that this Annotated Commit refers to. If this created from a reference,
1752
+ * the return value is `null`.
1753
+ * @throws Throws error if the refname is not valid utf-8.
1754
+ */
1755
+ refname(): string | null
1756
+ }
1718
1757
  /** A wrapper around git2::Blame providing Node.js bindings */
1719
1758
  export declare class Blame {
1720
1759
  /**
@@ -3931,6 +3970,57 @@ export declare class Remote {
3931
3970
  * This class corresponds to a git repository in libgit2.
3932
3971
  */
3933
3972
  export declare class Repository {
3973
+ /**
3974
+ * Creates an Annotated Commit from the given commit.
3975
+ *
3976
+ * @category Repository/Methods
3977
+ * @signature
3978
+ * ```ts
3979
+ * class Repository {
3980
+ * getAnnotatedCommit(commit: Commit): AnnotatedCommit;
3981
+ * }
3982
+ * ```
3983
+ *
3984
+ * @param {Commit} commit - Commit to creates a Annotated Commit.
3985
+ * @returns An Annotated Commit created from commit.
3986
+ */
3987
+ getAnnotatedCommit(commit: Commit): AnnotatedCommit
3988
+ /**
3989
+ * Creates a Annotated Commit from the given reference.
3990
+ *
3991
+ * @category Repository/Methods
3992
+ * @signature
3993
+ * ```ts
3994
+ * class Repository {
3995
+ * getAnnotatedCommitFromReference(reference: Reference): AnnotatedCommit;
3996
+ * }
3997
+ * ```
3998
+ *
3999
+ * @param {Reference} reference - Reference to creates a Annotated Commit.
4000
+ * @returns An Annotated Commit created from reference.
4001
+ */
4002
+ getAnnotatedCommitFromReference(reference: GitReference): AnnotatedCommit
4003
+ /**
4004
+ * Creates a Annotated Commit from `FETCH_HEAD`.
4005
+ *
4006
+ * @category Repository/Methods
4007
+ * @signature
4008
+ * ```ts
4009
+ * class Repository {
4010
+ * getAnnotatedCommitFromFetchHead(
4011
+ * branchName: string,
4012
+ * remoteUrl: string,
4013
+ * id: string,
4014
+ * ): AnnotatedCommit;
4015
+ * }
4016
+ * ```
4017
+ *
4018
+ * @param {String} branchName - Name of the remote branch.
4019
+ * @param {String} remoteUrl - Url of the remote.
4020
+ * @param {String} id - The commit object id of the remote branch.
4021
+ * @returns An Annotated Commit created from `FETCH_HEAD`.
4022
+ */
4023
+ getAnnotatedCommitFromFetchHead(branchName: string, remoteUrl: string, id: string): AnnotatedCommit
3934
4024
  /**
3935
4025
  * Creates a blame object for the file at the given path
3936
4026
  *
@@ -4701,6 +4791,64 @@ export declare class Repository {
4701
4791
  * @param {string} refname - Specified reference to point into `HEAD`.
4702
4792
  */
4703
4793
  setHead(refname: string): void
4794
+ /**
4795
+ * Determines whether the repository `HEAD` is detached.
4796
+ *
4797
+ * @category Repository/Methods
4798
+ * @signature
4799
+ * ```ts
4800
+ * class Repository {
4801
+ * headDetached(): boolean;
4802
+ * }
4803
+ * ```
4804
+ *
4805
+ * @returns Returns `true` if the repository `HEAD` is detached.
4806
+ */
4807
+ headDetached(): boolean
4808
+ /**
4809
+ * Make the repository HEAD directly point to the commit.
4810
+ *
4811
+ * If the provided commitish cannot be found in the repository, the HEAD
4812
+ * is unaltered and an error is returned.
4813
+ *
4814
+ * If the provided commitish cannot be peeled into a commit, the HEAD is
4815
+ * unaltered and an error is returned.
4816
+ *
4817
+ * Otherwise, the HEAD will eventually be detached and will directly point
4818
+ * to the peeled commit.
4819
+ *
4820
+ * @category Repository/Methods
4821
+ * @signature
4822
+ * ```ts
4823
+ * class Repository {
4824
+ * setHeadDetached(commitish: Commit): void;
4825
+ * }
4826
+ * ```
4827
+ *
4828
+ * @param {Commit} commitish - A Commit which the HEAD should point to.
4829
+ */
4830
+ setHeadDetached(commit: Commit): void
4831
+ /**
4832
+ * Make the repository HEAD directly point to the commit.
4833
+ *
4834
+ * If the provided commitish cannot be found in the repository, the HEAD
4835
+ * is unaltered and an error is returned.
4836
+ * If the provided commitish cannot be peeled into a commit, the HEAD is
4837
+ * unaltered and an error is returned.
4838
+ * Otherwise, the HEAD will eventually be detached and will directly point
4839
+ * to the peeled commit.
4840
+ *
4841
+ * @category Repository/Methods
4842
+ * @signature
4843
+ * ```ts
4844
+ * class Repository {
4845
+ * setHeadDetachedFromAnnotated(commitish: AnnotatedCommit): void;
4846
+ * }
4847
+ * ```
4848
+ *
4849
+ * @param {AnnotatedCommit} commitish - An Annotated Commit which the HEAD should point to.
4850
+ */
4851
+ setHeadDetachedFromAnnotated(commitish: AnnotatedCommit): void
4704
4852
  /**
4705
4853
  * Extract a signature from an object identified by its ID.
4706
4854
  *
package/index.js CHANGED
@@ -310,8 +310,9 @@ if (!nativeBinding) {
310
310
  throw new Error(`Failed to load native binding`)
311
311
  }
312
312
 
313
- const { Blame, BlameHunks, BlameHunksByLine, Blob, isValidBranchName, Branch, Branches, BranchType, Commit, ConfigLevel, ConfigEntries, Config, openConfig, openDefaultConfig, findGlobalConfigPath, findSystemConfigPath, findXdgConfigPath, parseConfigBool, parseConfigI32, parseConfigI64, DiffFlags, diffFlagsContains, DeltaType, DiffFormat, Diff, DiffStats, Deltas, DiffDelta, FileMode, DiffFile, IndexStage, Index, IndexEntries, Mailmap, createMailmapFromBuffer, ObjectType, GitObject, isValidOid, isZeroOid, zeroOid, hashObjectOid, hashFileOid, ReferenceType, Reference, isValidReferenceName, ReferenceFormat, normalizeReferenceName, Direction, CredentialType, FetchPrune, AutotagOption, RemoteRedirect, Remote, RepositoryState, RepositoryInitMode, Repository, initRepository, openRepository, discoverRepository, cloneRepository, RevparseMode, revparseModeContains, RevwalkSort, Revwalk, createSignature, StatusShow, Statuses, StatusesIter, StatusEntry, isValidTagName, Tag, TreeWalkMode, Tree, TreeIter, TreeEntry } = nativeBinding
313
+ const { AnnotatedCommit, Blame, BlameHunks, BlameHunksByLine, Blob, isValidBranchName, Branch, Branches, BranchType, Commit, ConfigLevel, ConfigEntries, Config, openConfig, openDefaultConfig, findGlobalConfigPath, findSystemConfigPath, findXdgConfigPath, parseConfigBool, parseConfigI32, parseConfigI64, DiffFlags, diffFlagsContains, DeltaType, DiffFormat, Diff, DiffStats, Deltas, DiffDelta, FileMode, DiffFile, IndexStage, Index, IndexEntries, Mailmap, createMailmapFromBuffer, ObjectType, GitObject, isValidOid, isZeroOid, zeroOid, hashObjectOid, hashFileOid, ReferenceType, Reference, isValidReferenceName, ReferenceFormat, normalizeReferenceName, Direction, CredentialType, FetchPrune, AutotagOption, RemoteRedirect, Remote, RepositoryState, RepositoryInitMode, Repository, initRepository, openRepository, discoverRepository, cloneRepository, RevparseMode, revparseModeContains, RevwalkSort, Revwalk, createSignature, StatusShow, Statuses, StatusesIter, StatusEntry, isValidTagName, Tag, TreeWalkMode, Tree, TreeIter, TreeEntry } = nativeBinding
314
314
 
315
+ module.exports.AnnotatedCommit = AnnotatedCommit
315
316
  module.exports.Blame = Blame
316
317
  module.exports.BlameHunks = BlameHunks
317
318
  module.exports.BlameHunksByLine = BlameHunksByLine
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "es-git",
3
- "version": "0.3.0-next.129+c063836",
3
+ "version": "0.3.0-next.130+bc0b2c7",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "files": [
@@ -57,15 +57,15 @@
57
57
  "vitest": "^3.0.5"
58
58
  },
59
59
  "optionalDependencies": {
60
- "es-git-darwin-x64": "0.3.0-next.129+c063836",
61
- "es-git-darwin-arm64": "0.3.0-next.129+c063836",
62
- "es-git-win32-x64-msvc": "0.3.0-next.129+c063836",
63
- "es-git-win32-arm64-msvc": "0.3.0-next.129+c063836",
64
- "es-git-linux-x64-gnu": "0.3.0-next.129+c063836",
65
- "es-git-linux-x64-musl": "0.3.0-next.129+c063836",
66
- "es-git-android-arm64": "0.3.0-next.129+c063836",
67
- "es-git-linux-arm64-gnu": "0.3.0-next.129+c063836",
68
- "es-git-linux-arm64-musl": "0.3.0-next.129+c063836",
69
- "es-git-android-arm-eabi": "0.3.0-next.129+c063836"
60
+ "es-git-darwin-x64": "0.3.0-next.130+bc0b2c7",
61
+ "es-git-darwin-arm64": "0.3.0-next.130+bc0b2c7",
62
+ "es-git-win32-x64-msvc": "0.3.0-next.130+bc0b2c7",
63
+ "es-git-win32-arm64-msvc": "0.3.0-next.130+bc0b2c7",
64
+ "es-git-linux-x64-gnu": "0.3.0-next.130+bc0b2c7",
65
+ "es-git-linux-x64-musl": "0.3.0-next.130+bc0b2c7",
66
+ "es-git-android-arm64": "0.3.0-next.130+bc0b2c7",
67
+ "es-git-linux-arm64-gnu": "0.3.0-next.130+bc0b2c7",
68
+ "es-git-linux-arm64-musl": "0.3.0-next.130+bc0b2c7",
69
+ "es-git-android-arm-eabi": "0.3.0-next.130+bc0b2c7"
70
70
  }
71
71
  }