es-git 0.3.0-next.129 → 0.3.0-next.131
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/index.d.ts +499 -0
- package/index.js +3 -1
- package/package.json +11 -11
package/index.d.ts
CHANGED
|
@@ -825,6 +825,125 @@ export interface AddMailmapEntryData {
|
|
|
825
825
|
* ```
|
|
826
826
|
*/
|
|
827
827
|
export declare function createMailmapFromBuffer(content: string): Mailmap
|
|
828
|
+
export type FileFavor = /**
|
|
829
|
+
* When a region of a file is changed in both branches, a conflict will be
|
|
830
|
+
* recorded in the index so that git_checkout can produce a merge file with
|
|
831
|
+
* conflict markers in the working directory. This is the default.
|
|
832
|
+
*/
|
|
833
|
+
'Normal' | /**
|
|
834
|
+
* When a region of a file is changed in both branches, the file created
|
|
835
|
+
* in the index will contain the "ours" side of any conflicting region.
|
|
836
|
+
* The index will not record a conflict.
|
|
837
|
+
*/
|
|
838
|
+
'Ours' | /**
|
|
839
|
+
* When a region of a file is changed in both branches, the file created
|
|
840
|
+
* in the index will contain the "theirs" side of any conflicting region.
|
|
841
|
+
* The index will not record a conflict.
|
|
842
|
+
*/
|
|
843
|
+
'Theirs' | /**
|
|
844
|
+
* When a region of a file is changed in both branches, the file created
|
|
845
|
+
* in the index will contain each unique line from each side, which has
|
|
846
|
+
* the result of combining both files. The index will not record a conflict.
|
|
847
|
+
*/
|
|
848
|
+
'Union';
|
|
849
|
+
export interface MergeOptions {
|
|
850
|
+
/** Detect file renames */
|
|
851
|
+
findRenames?: boolean
|
|
852
|
+
/**
|
|
853
|
+
* If a conflict occurs, exit immediately instead of attempting to continue
|
|
854
|
+
* resolving conflicts
|
|
855
|
+
*/
|
|
856
|
+
failOnConflict?: boolean
|
|
857
|
+
/** Do not write the REUC extension on the generated index */
|
|
858
|
+
skipReuc?: boolean
|
|
859
|
+
/**
|
|
860
|
+
* If the commits being merged have multiple merge bases, do not build a
|
|
861
|
+
* recursive merge base (by merging the multiple merge bases), instead
|
|
862
|
+
* simply use the first base.
|
|
863
|
+
*/
|
|
864
|
+
noRecursive?: boolean
|
|
865
|
+
/** Similarity to consider a file renamed (default 50) */
|
|
866
|
+
renameThreshold?: number
|
|
867
|
+
/**
|
|
868
|
+
* Maximum similarity sources to examine for renames (default 200).
|
|
869
|
+
* If the number of rename candidates (add / delete pairs) is greater
|
|
870
|
+
* than this value, inexact rename detection is aborted. This setting
|
|
871
|
+
* overrides the `merge.renameLimit` configuration value.
|
|
872
|
+
*/
|
|
873
|
+
targetLimit?: number
|
|
874
|
+
/**
|
|
875
|
+
* Maximum number of times to merge common ancestors to build a
|
|
876
|
+
* virtual merge base when faced with criss-cross merges. When
|
|
877
|
+
* this limit is reached, the next ancestor will simply be used
|
|
878
|
+
* instead of attempting to merge it. The default is unlimited.
|
|
879
|
+
*/
|
|
880
|
+
recursionLimit?: number
|
|
881
|
+
/** Specify a side to favor for resolving conflicts */
|
|
882
|
+
filFavor?: FileFavor
|
|
883
|
+
/** Create standard conflicted merge files */
|
|
884
|
+
standardStyle?: boolean
|
|
885
|
+
/** Create diff3-style file */
|
|
886
|
+
diff3Style?: boolean
|
|
887
|
+
/** Condense non-alphanumeric regions for simplified diff file */
|
|
888
|
+
simplifyAlnum?: boolean
|
|
889
|
+
/** Ignore all whitespace */
|
|
890
|
+
ignoreWhitespace?: boolean
|
|
891
|
+
/** Ignore changes in amount of whitespace */
|
|
892
|
+
ignoreWhitespaceChange?: boolean
|
|
893
|
+
/** Ignore whitespace at end of line */
|
|
894
|
+
ignoreWhitespaceEol?: boolean
|
|
895
|
+
/** Use the "patience diff" algorithm */
|
|
896
|
+
patience?: boolean
|
|
897
|
+
/** Take extra time to find minimal diff */
|
|
898
|
+
minimal?: boolean
|
|
899
|
+
}
|
|
900
|
+
export interface MergeAnalysis {
|
|
901
|
+
/** No merge is possible. */
|
|
902
|
+
none: boolean
|
|
903
|
+
/**
|
|
904
|
+
* A "normal" merge; both HEAD and the given merge input have diverged
|
|
905
|
+
* from their common ancestor. The divergent commits must be merged.
|
|
906
|
+
*/
|
|
907
|
+
normal: boolean
|
|
908
|
+
/**
|
|
909
|
+
* All given merge inputs are reachable from HEAD, meaning the
|
|
910
|
+
* repository is up-to-date and no merge needs to be performed.
|
|
911
|
+
*/
|
|
912
|
+
upToDate: boolean
|
|
913
|
+
/**
|
|
914
|
+
* The given merge input is a fast-forward from HEAD and no merge
|
|
915
|
+
* needs to be performed. Instead, the client can check out the
|
|
916
|
+
* given merge input.
|
|
917
|
+
*/
|
|
918
|
+
fastForward: boolean
|
|
919
|
+
/**
|
|
920
|
+
* The HEAD of the current repository is "unborn" and does not point to
|
|
921
|
+
* a valid commit. No merge can be performed, but the caller may wish
|
|
922
|
+
* to simply set HEAD to the target commit(s).
|
|
923
|
+
*/
|
|
924
|
+
unborn: boolean
|
|
925
|
+
}
|
|
926
|
+
export interface MergePreference {
|
|
927
|
+
/**
|
|
928
|
+
* No configuration was found that suggests a preferred behavior for
|
|
929
|
+
* merge.
|
|
930
|
+
*/
|
|
931
|
+
none: boolean
|
|
932
|
+
/**
|
|
933
|
+
* There is a `merge.ff=false` configuration setting, suggesting that
|
|
934
|
+
* the user does not want to allow a fast-forward merge.
|
|
935
|
+
*/
|
|
936
|
+
noFastForward: boolean
|
|
937
|
+
/**
|
|
938
|
+
* There is a `merge.ff=only` configuration setting, suggesting that
|
|
939
|
+
* the user only wants fast-forward merges.
|
|
940
|
+
*/
|
|
941
|
+
fastForwardOnly: boolean
|
|
942
|
+
}
|
|
943
|
+
export interface MergeAnalysisResult {
|
|
944
|
+
analysis: MergeAnalysis
|
|
945
|
+
preference: MergePreference
|
|
946
|
+
}
|
|
828
947
|
/**
|
|
829
948
|
* - `Any` : Any kind of git object
|
|
830
949
|
* - `Commit` : An object which corresponds to a git commit
|
|
@@ -1715,6 +1834,45 @@ export interface CreateLightweightTagOptions {
|
|
|
1715
1834
|
* - `PostOrder` : Runs the traversal in post-order.
|
|
1716
1835
|
*/
|
|
1717
1836
|
export type TreeWalkMode = 'PreOrder' | 'PostOrder';
|
|
1837
|
+
/**
|
|
1838
|
+
* A structure to represent an annotated commit, the input to merge and rebase.
|
|
1839
|
+
*
|
|
1840
|
+
* An annotated commit contains information about how it was looked up, which
|
|
1841
|
+
* may be useful for functions like merge or rebase to provide context to the
|
|
1842
|
+
* operation.
|
|
1843
|
+
*/
|
|
1844
|
+
export declare class AnnotatedCommit {
|
|
1845
|
+
/**
|
|
1846
|
+
* Gets the commit ID that the given Annotated Commit refers to.
|
|
1847
|
+
*
|
|
1848
|
+
* @category AnnotatedCommit/Methods
|
|
1849
|
+
* @signature
|
|
1850
|
+
* ```ts
|
|
1851
|
+
* class AnnotatedCommit {
|
|
1852
|
+
* id(): string;
|
|
1853
|
+
* }
|
|
1854
|
+
* ```
|
|
1855
|
+
*
|
|
1856
|
+
* @returns The commit ID that this Annotated Commit refers to.
|
|
1857
|
+
*/
|
|
1858
|
+
id(): string
|
|
1859
|
+
/**
|
|
1860
|
+
* Get the refname that the given Annotated Commit refers to.
|
|
1861
|
+
*
|
|
1862
|
+
* @category AnnotatedCommit/Methods
|
|
1863
|
+
* @signature
|
|
1864
|
+
* ```ts
|
|
1865
|
+
* class AnnotatedCommit {
|
|
1866
|
+
* refname(): string | null;
|
|
1867
|
+
* }
|
|
1868
|
+
* ```
|
|
1869
|
+
*
|
|
1870
|
+
* @returns The refname that this Annotated Commit refers to. If this created from a reference,
|
|
1871
|
+
* the return value is `null`.
|
|
1872
|
+
* @throws Throws error if the refname is not valid utf-8.
|
|
1873
|
+
*/
|
|
1874
|
+
refname(): string | null
|
|
1875
|
+
}
|
|
1718
1876
|
/** A wrapper around git2::Blame providing Node.js bindings */
|
|
1719
1877
|
export declare class Blame {
|
|
1720
1878
|
/**
|
|
@@ -3931,6 +4089,57 @@ export declare class Remote {
|
|
|
3931
4089
|
* This class corresponds to a git repository in libgit2.
|
|
3932
4090
|
*/
|
|
3933
4091
|
export declare class Repository {
|
|
4092
|
+
/**
|
|
4093
|
+
* Creates an Annotated Commit from the given commit.
|
|
4094
|
+
*
|
|
4095
|
+
* @category Repository/Methods
|
|
4096
|
+
* @signature
|
|
4097
|
+
* ```ts
|
|
4098
|
+
* class Repository {
|
|
4099
|
+
* getAnnotatedCommit(commit: Commit): AnnotatedCommit;
|
|
4100
|
+
* }
|
|
4101
|
+
* ```
|
|
4102
|
+
*
|
|
4103
|
+
* @param {Commit} commit - Commit to creates a Annotated Commit.
|
|
4104
|
+
* @returns An Annotated Commit created from commit.
|
|
4105
|
+
*/
|
|
4106
|
+
getAnnotatedCommit(commit: Commit): AnnotatedCommit
|
|
4107
|
+
/**
|
|
4108
|
+
* Creates a Annotated Commit from the given reference.
|
|
4109
|
+
*
|
|
4110
|
+
* @category Repository/Methods
|
|
4111
|
+
* @signature
|
|
4112
|
+
* ```ts
|
|
4113
|
+
* class Repository {
|
|
4114
|
+
* getAnnotatedCommitFromReference(reference: Reference): AnnotatedCommit;
|
|
4115
|
+
* }
|
|
4116
|
+
* ```
|
|
4117
|
+
*
|
|
4118
|
+
* @param {Reference} reference - Reference to creates a Annotated Commit.
|
|
4119
|
+
* @returns An Annotated Commit created from reference.
|
|
4120
|
+
*/
|
|
4121
|
+
getAnnotatedCommitFromReference(reference: GitReference): AnnotatedCommit
|
|
4122
|
+
/**
|
|
4123
|
+
* Creates a Annotated Commit from `FETCH_HEAD`.
|
|
4124
|
+
*
|
|
4125
|
+
* @category Repository/Methods
|
|
4126
|
+
* @signature
|
|
4127
|
+
* ```ts
|
|
4128
|
+
* class Repository {
|
|
4129
|
+
* getAnnotatedCommitFromFetchHead(
|
|
4130
|
+
* branchName: string,
|
|
4131
|
+
* remoteUrl: string,
|
|
4132
|
+
* id: string,
|
|
4133
|
+
* ): AnnotatedCommit;
|
|
4134
|
+
* }
|
|
4135
|
+
* ```
|
|
4136
|
+
*
|
|
4137
|
+
* @param {String} branchName - Name of the remote branch.
|
|
4138
|
+
* @param {String} remoteUrl - Url of the remote.
|
|
4139
|
+
* @param {String} id - The commit object id of the remote branch.
|
|
4140
|
+
* @returns An Annotated Commit created from `FETCH_HEAD`.
|
|
4141
|
+
*/
|
|
4142
|
+
getAnnotatedCommitFromFetchHead(branchName: string, remoteUrl: string, id: string): AnnotatedCommit
|
|
3934
4143
|
/**
|
|
3935
4144
|
* Creates a blame object for the file at the given path
|
|
3936
4145
|
*
|
|
@@ -4408,6 +4617,225 @@ export declare class Repository {
|
|
|
4408
4617
|
* @returns The mailmap object if it exists, null otherwise
|
|
4409
4618
|
*/
|
|
4410
4619
|
mailmap(): Mailmap | null
|
|
4620
|
+
/**
|
|
4621
|
+
* Find a merge base between two commits
|
|
4622
|
+
*
|
|
4623
|
+
* @category Repository/Methods
|
|
4624
|
+
* @signature
|
|
4625
|
+
* ```ts
|
|
4626
|
+
* class Repository {
|
|
4627
|
+
* mergeBase(one: string, two: string): string;
|
|
4628
|
+
* }
|
|
4629
|
+
* ```
|
|
4630
|
+
*
|
|
4631
|
+
* @param {string} one - One of the commits OID.
|
|
4632
|
+
* @param {string} two - The other commit OID.
|
|
4633
|
+
* @returns The OID of a merge base between 'one' and 'two'.
|
|
4634
|
+
*/
|
|
4635
|
+
getMergeBase(one: string, two: string): string
|
|
4636
|
+
/**
|
|
4637
|
+
* Find a merge base given a list of commits
|
|
4638
|
+
*
|
|
4639
|
+
* This behaves similar to [`git merge-base`](https://git-scm.com/docs/git-merge-base#_discussion).
|
|
4640
|
+
* Given three commits `a`, `b`, and `c`, `getMergeBaseMany([a, b, c])`
|
|
4641
|
+
* will compute a hypothetical commit `m`, which is a merge between `b`
|
|
4642
|
+
* and `c`.
|
|
4643
|
+
*
|
|
4644
|
+
* For example, with the following topology:
|
|
4645
|
+
* ```text
|
|
4646
|
+
* o---o---o---o---C
|
|
4647
|
+
* /
|
|
4648
|
+
* / o---o---o---B
|
|
4649
|
+
* / /
|
|
4650
|
+
* ---2---1---o---o---o---A
|
|
4651
|
+
* ```
|
|
4652
|
+
*
|
|
4653
|
+
* the result of `getMergeBaseMany([a, b, c])` is 1. This is because the
|
|
4654
|
+
* equivalent topology with a merge commit `m` between `b` and `c` would
|
|
4655
|
+
* is:
|
|
4656
|
+
* ```text
|
|
4657
|
+
* o---o---o---o---o
|
|
4658
|
+
* / \
|
|
4659
|
+
* / o---o---o---o---M
|
|
4660
|
+
* / /
|
|
4661
|
+
* ---2---1---o---o---o---A
|
|
4662
|
+
* ```
|
|
4663
|
+
*
|
|
4664
|
+
* and the result of `getMergeBaseMany([a, m])` is 1.
|
|
4665
|
+
*
|
|
4666
|
+
* ---
|
|
4667
|
+
*
|
|
4668
|
+
* If you're looking to recieve the common merge base between all the
|
|
4669
|
+
* given commits, use `getMergeBaseOctopus`.
|
|
4670
|
+
*
|
|
4671
|
+
* @category Repository/Methods
|
|
4672
|
+
* @signature
|
|
4673
|
+
* ```ts
|
|
4674
|
+
* class Repository {
|
|
4675
|
+
* getMergeBaseMany(oids: string[]): string;
|
|
4676
|
+
* }
|
|
4677
|
+
* ```
|
|
4678
|
+
*
|
|
4679
|
+
* @param {string[]} oids - Oids of the commits.
|
|
4680
|
+
* @returns The OID of a merge base considering all the commits.
|
|
4681
|
+
*/
|
|
4682
|
+
getMergeBaseMany(oids: Array<string>): string
|
|
4683
|
+
/**
|
|
4684
|
+
* Find a merge base in preparation for an octopus merge.
|
|
4685
|
+
*
|
|
4686
|
+
* @category Repository/Methods
|
|
4687
|
+
* @signature
|
|
4688
|
+
* ```ts
|
|
4689
|
+
* class Repository {
|
|
4690
|
+
* getMergeBaseOctopus(oids: string[]): string;
|
|
4691
|
+
* }
|
|
4692
|
+
* ```
|
|
4693
|
+
*
|
|
4694
|
+
* @param {string[]} oids - Oids of the commits.
|
|
4695
|
+
* @returns The OID of a merge base considering all the commits.
|
|
4696
|
+
*/
|
|
4697
|
+
getMergeBaseOctopus(oids: Array<string>): string
|
|
4698
|
+
/**
|
|
4699
|
+
* Find all merge bases between two commits
|
|
4700
|
+
*
|
|
4701
|
+
* @category Repository/Methods
|
|
4702
|
+
* @signature
|
|
4703
|
+
* ```ts
|
|
4704
|
+
* class Repository {
|
|
4705
|
+
* getMergeBases(one: string, two: string): string[];
|
|
4706
|
+
* }
|
|
4707
|
+
* ```
|
|
4708
|
+
*
|
|
4709
|
+
* @param {string} one - One of the commits OID.
|
|
4710
|
+
* @param {string} two - The other commit OID.
|
|
4711
|
+
* @returns Array in which to store the resulting OIDs.
|
|
4712
|
+
*/
|
|
4713
|
+
getMergeBases(one: string, two: string): Array<string>
|
|
4714
|
+
/**
|
|
4715
|
+
* Find all merge bases given a list of commits
|
|
4716
|
+
*
|
|
4717
|
+
* @category Repository/Methods
|
|
4718
|
+
* @signature
|
|
4719
|
+
* ```ts
|
|
4720
|
+
* class Repository {
|
|
4721
|
+
* getMergeBasesMany(oids: string[]): string[];
|
|
4722
|
+
* }
|
|
4723
|
+
* ```
|
|
4724
|
+
*
|
|
4725
|
+
* @param {string[]} oids - Oids of the commits.
|
|
4726
|
+
* @returns Array in which to store the resulting OIDs.
|
|
4727
|
+
*/
|
|
4728
|
+
getMergeBasesMany(oids: Array<string>): Array<string>
|
|
4729
|
+
/**
|
|
4730
|
+
* Merges the given commit(s) into HEAD, writing the results into the
|
|
4731
|
+
* working directory. Any changes are staged for commit and any conflicts
|
|
4732
|
+
* are written to the index. Callers should inspect the repository's index
|
|
4733
|
+
* after this completes, resolve any conflicts and prepare a commit.
|
|
4734
|
+
*
|
|
4735
|
+
* For compatibility with git, the repository is put into a merging state.
|
|
4736
|
+
* Once the commit is done (or if the user wishes to abort), you should
|
|
4737
|
+
* clear this state by calling `cleanupState()`.
|
|
4738
|
+
*
|
|
4739
|
+
* @category Repository/Methods
|
|
4740
|
+
* @signature
|
|
4741
|
+
* ```ts
|
|
4742
|
+
* class Repository {
|
|
4743
|
+
* merge(
|
|
4744
|
+
* annotatedCommits: AnnotatedCommit[],
|
|
4745
|
+
* mergeOptions?: MergeOptions | undefined | null,
|
|
4746
|
+
* checkoutOptions?: CheckoutOptions | undefined | null,
|
|
4747
|
+
* ): void;
|
|
4748
|
+
* }
|
|
4749
|
+
* ```
|
|
4750
|
+
*
|
|
4751
|
+
* @param {AnnotatedCommit[]} annotatedCommits - Commits to merge.
|
|
4752
|
+
* @param {MergeOptions} [mergeOptions] - Merge options.
|
|
4753
|
+
* @param {CheckoutOptions} [checkoutOptions] - Checkout options.
|
|
4754
|
+
*/
|
|
4755
|
+
merge(annotatedCommits: Array<AnnotatedCommit>, mergeOptions?: MergeOptions | undefined | null, checkoutOptions?: CheckoutOptions | undefined | null): void
|
|
4756
|
+
/**
|
|
4757
|
+
* Merge two commits, producing an index that reflects the result of
|
|
4758
|
+
* the merge. The index may be written as-is to the working directory or
|
|
4759
|
+
* checked out. If the index is to be converted to a tree, the caller
|
|
4760
|
+
* should resolve any conflicts that arose as part of the merge.
|
|
4761
|
+
*
|
|
4762
|
+
* @category Repository/Methods
|
|
4763
|
+
* @signature
|
|
4764
|
+
* ```ts
|
|
4765
|
+
* class Repository {
|
|
4766
|
+
* mergeCommits(
|
|
4767
|
+
* ourCommit: Commit,
|
|
4768
|
+
* theirCommit: Commit,
|
|
4769
|
+
* options?: MergeOptions | undefined | null,
|
|
4770
|
+
* ): Index;
|
|
4771
|
+
* }
|
|
4772
|
+
* ```
|
|
4773
|
+
*
|
|
4774
|
+
* @param {Commit} outCommit - The commit that reflects the destination tree.
|
|
4775
|
+
* @param {Commit} theirCommit - The commit to merge in to `ourCommit`.
|
|
4776
|
+
* @param {MergeOptions} [options] - Merge options.
|
|
4777
|
+
* @returns The index result.
|
|
4778
|
+
*/
|
|
4779
|
+
mergeCommits(ourCommit: Commit, theirCommit: Commit, options?: MergeOptions | undefined | null): Index
|
|
4780
|
+
/**
|
|
4781
|
+
* Merge two trees, producing an index that reflects the result of
|
|
4782
|
+
* the merge. The index may be written as-is to the working directory or
|
|
4783
|
+
* checked out. If the index is to be converted to a tree, the caller
|
|
4784
|
+
* should resolve any conflicts that arose as part of the merge.
|
|
4785
|
+
*
|
|
4786
|
+
* @category Repository/Methods
|
|
4787
|
+
* @signature
|
|
4788
|
+
* ```ts
|
|
4789
|
+
* class Repository {
|
|
4790
|
+
* mergeTrees(
|
|
4791
|
+
* ancestorTree: Tree,
|
|
4792
|
+
* ourTree: Tree,
|
|
4793
|
+
* theirTree: Tree,
|
|
4794
|
+
* options?: MergeOptions | undefined | null,
|
|
4795
|
+
* ): Index;
|
|
4796
|
+
* }
|
|
4797
|
+
* ```
|
|
4798
|
+
*
|
|
4799
|
+
* @param {Tree} ancestorTree - The common ancestor between.
|
|
4800
|
+
* @param {Tree} outTree - The tree that reflects the destination tree.
|
|
4801
|
+
* @param {Tree} theirTree - The tree to merge in to `ourTree`.
|
|
4802
|
+
* @param {MergeOptions} [options] - Merge options.
|
|
4803
|
+
* @returns The index result.
|
|
4804
|
+
*/
|
|
4805
|
+
mergeTrees(ancestorTree: Tree, ourTree: Tree, theirTree: Tree, options?: MergeOptions | undefined | null): Index
|
|
4806
|
+
/**
|
|
4807
|
+
* Analyzes the given branch(es) and determines the opportunities for
|
|
4808
|
+
* merging them into the HEAD of the repository.
|
|
4809
|
+
*
|
|
4810
|
+
* @category Repository/Methods
|
|
4811
|
+
* @signature
|
|
4812
|
+
* ```ts
|
|
4813
|
+
* class Repository {
|
|
4814
|
+
* analyzeMergeFor(theirHeads: AnnotatedCommit[]): MergeAnalysisResult;
|
|
4815
|
+
* }
|
|
4816
|
+
* ```
|
|
4817
|
+
*
|
|
4818
|
+
* @param {AnnotatedCommit[]} theirHeads - The heads to merge into.
|
|
4819
|
+
* @returns Merge analysis result.
|
|
4820
|
+
*/
|
|
4821
|
+
analyzeMerge(theirHeads: Array<AnnotatedCommit>): MergeAnalysisResult
|
|
4822
|
+
/**
|
|
4823
|
+
* Analyzes the given branch(es) and determines the opportunities for
|
|
4824
|
+
* merging them into a reference.
|
|
4825
|
+
*
|
|
4826
|
+
* @category Repository/Methods
|
|
4827
|
+
* @signature
|
|
4828
|
+
* ```ts
|
|
4829
|
+
* class Repository {
|
|
4830
|
+
* analyzeMergeForRef(ourRef: Reference, theirHeads: AnnotatedCommit[]): MergeAnalysisResult;
|
|
4831
|
+
* }
|
|
4832
|
+
* ```
|
|
4833
|
+
*
|
|
4834
|
+
* @param {Reference} ourRef - The reference to perform the analysis from.
|
|
4835
|
+
* @param {AnnotatedCommit[]} theirHeads - The heads to merge into.
|
|
4836
|
+
* @returns Merge analysis result.
|
|
4837
|
+
*/
|
|
4838
|
+
analyzeMergeForRef(ourRef: Reference, theirHeads: Array<AnnotatedCommit>): MergeAnalysisResult
|
|
4411
4839
|
/**
|
|
4412
4840
|
* Lookup a reference to one of the objects in a repository.
|
|
4413
4841
|
*
|
|
@@ -4701,6 +5129,64 @@ export declare class Repository {
|
|
|
4701
5129
|
* @param {string} refname - Specified reference to point into `HEAD`.
|
|
4702
5130
|
*/
|
|
4703
5131
|
setHead(refname: string): void
|
|
5132
|
+
/**
|
|
5133
|
+
* Determines whether the repository `HEAD` is detached.
|
|
5134
|
+
*
|
|
5135
|
+
* @category Repository/Methods
|
|
5136
|
+
* @signature
|
|
5137
|
+
* ```ts
|
|
5138
|
+
* class Repository {
|
|
5139
|
+
* headDetached(): boolean;
|
|
5140
|
+
* }
|
|
5141
|
+
* ```
|
|
5142
|
+
*
|
|
5143
|
+
* @returns Returns `true` if the repository `HEAD` is detached.
|
|
5144
|
+
*/
|
|
5145
|
+
headDetached(): boolean
|
|
5146
|
+
/**
|
|
5147
|
+
* Make the repository HEAD directly point to the commit.
|
|
5148
|
+
*
|
|
5149
|
+
* If the provided commitish cannot be found in the repository, the HEAD
|
|
5150
|
+
* is unaltered and an error is returned.
|
|
5151
|
+
*
|
|
5152
|
+
* If the provided commitish cannot be peeled into a commit, the HEAD is
|
|
5153
|
+
* unaltered and an error is returned.
|
|
5154
|
+
*
|
|
5155
|
+
* Otherwise, the HEAD will eventually be detached and will directly point
|
|
5156
|
+
* to the peeled commit.
|
|
5157
|
+
*
|
|
5158
|
+
* @category Repository/Methods
|
|
5159
|
+
* @signature
|
|
5160
|
+
* ```ts
|
|
5161
|
+
* class Repository {
|
|
5162
|
+
* setHeadDetached(commitish: Commit): void;
|
|
5163
|
+
* }
|
|
5164
|
+
* ```
|
|
5165
|
+
*
|
|
5166
|
+
* @param {Commit} commitish - A Commit which the HEAD should point to.
|
|
5167
|
+
*/
|
|
5168
|
+
setHeadDetached(commit: Commit): void
|
|
5169
|
+
/**
|
|
5170
|
+
* Make the repository HEAD directly point to the commit.
|
|
5171
|
+
*
|
|
5172
|
+
* If the provided commitish cannot be found in the repository, the HEAD
|
|
5173
|
+
* is unaltered and an error is returned.
|
|
5174
|
+
* If the provided commitish cannot be peeled into a commit, the HEAD is
|
|
5175
|
+
* unaltered and an error is returned.
|
|
5176
|
+
* Otherwise, the HEAD will eventually be detached and will directly point
|
|
5177
|
+
* to the peeled commit.
|
|
5178
|
+
*
|
|
5179
|
+
* @category Repository/Methods
|
|
5180
|
+
* @signature
|
|
5181
|
+
* ```ts
|
|
5182
|
+
* class Repository {
|
|
5183
|
+
* setHeadDetachedFromAnnotated(commitish: AnnotatedCommit): void;
|
|
5184
|
+
* }
|
|
5185
|
+
* ```
|
|
5186
|
+
*
|
|
5187
|
+
* @param {AnnotatedCommit} commitish - An Annotated Commit which the HEAD should point to.
|
|
5188
|
+
*/
|
|
5189
|
+
setHeadDetachedFromAnnotated(commitish: AnnotatedCommit): void
|
|
4704
5190
|
/**
|
|
4705
5191
|
* Extract a signature from an object identified by its ID.
|
|
4706
5192
|
*
|
|
@@ -4720,6 +5206,19 @@ export declare class Repository {
|
|
|
4720
5206
|
* or null if the object is not signed.
|
|
4721
5207
|
*/
|
|
4722
5208
|
extractSignature(oid: string): ExtractedSignature | null
|
|
5209
|
+
/**
|
|
5210
|
+
* Remove all the metadata associated with an ongoing command like merge,
|
|
5211
|
+
* revert, cherry-pick, etc. For example: `MERGE_HEAD`, `MERGE_MSG`, etc.
|
|
5212
|
+
*
|
|
5213
|
+
* @category Repository/Methods
|
|
5214
|
+
* @signature
|
|
5215
|
+
* ```ts
|
|
5216
|
+
* class Repository {
|
|
5217
|
+
* cleanupState(): void;
|
|
5218
|
+
* }
|
|
5219
|
+
* ```
|
|
5220
|
+
*/
|
|
5221
|
+
cleanupState(): void
|
|
4723
5222
|
/**
|
|
4724
5223
|
* Execute a rev-parse operation against the `spec` listed.
|
|
4725
5224
|
*
|
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, FileFavor, 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
|
|
@@ -347,6 +348,7 @@ module.exports.Index = Index
|
|
|
347
348
|
module.exports.IndexEntries = IndexEntries
|
|
348
349
|
module.exports.Mailmap = Mailmap
|
|
349
350
|
module.exports.createMailmapFromBuffer = createMailmapFromBuffer
|
|
351
|
+
module.exports.FileFavor = FileFavor
|
|
350
352
|
module.exports.ObjectType = ObjectType
|
|
351
353
|
module.exports.GitObject = GitObject
|
|
352
354
|
module.exports.isValidOid = isValidOid
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-git",
|
|
3
|
-
"version": "0.3.0-next.
|
|
3
|
+
"version": "0.3.0-next.131+28f3abd",
|
|
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.
|
|
61
|
-
"es-git-darwin-arm64": "0.3.0-next.
|
|
62
|
-
"es-git-win32-x64-msvc": "0.3.0-next.
|
|
63
|
-
"es-git-win32-arm64-msvc": "0.3.0-next.
|
|
64
|
-
"es-git-linux-x64-gnu": "0.3.0-next.
|
|
65
|
-
"es-git-linux-x64-musl": "0.3.0-next.
|
|
66
|
-
"es-git-android-arm64": "0.3.0-next.
|
|
67
|
-
"es-git-linux-arm64-gnu": "0.3.0-next.
|
|
68
|
-
"es-git-linux-arm64-musl": "0.3.0-next.
|
|
69
|
-
"es-git-android-arm-eabi": "0.3.0-next.
|
|
60
|
+
"es-git-darwin-x64": "0.3.0-next.131+28f3abd",
|
|
61
|
+
"es-git-darwin-arm64": "0.3.0-next.131+28f3abd",
|
|
62
|
+
"es-git-win32-x64-msvc": "0.3.0-next.131+28f3abd",
|
|
63
|
+
"es-git-win32-arm64-msvc": "0.3.0-next.131+28f3abd",
|
|
64
|
+
"es-git-linux-x64-gnu": "0.3.0-next.131+28f3abd",
|
|
65
|
+
"es-git-linux-x64-musl": "0.3.0-next.131+28f3abd",
|
|
66
|
+
"es-git-android-arm64": "0.3.0-next.131+28f3abd",
|
|
67
|
+
"es-git-linux-arm64-gnu": "0.3.0-next.131+28f3abd",
|
|
68
|
+
"es-git-linux-arm64-musl": "0.3.0-next.131+28f3abd",
|
|
69
|
+
"es-git-android-arm-eabi": "0.3.0-next.131+28f3abd"
|
|
70
70
|
}
|
|
71
71
|
}
|