es-git 0.5.0-next.171 → 0.5.0-next.172
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 +634 -2
- package/index.js +5 -0
- package/package.json +11 -11
package/index.d.ts
CHANGED
|
@@ -2407,7 +2407,7 @@ export declare class Reflog {
|
|
|
2407
2407
|
* ```
|
|
2408
2408
|
*
|
|
2409
2409
|
* @param {number} i - Index of the entry to remove.
|
|
2410
|
-
* @param {boolean} [rewritePreviousEntry] - Whether to rewrite the previous entry. Defaults to
|
|
2410
|
+
* @param {boolean} [rewritePreviousEntry] - Whether to rewrite the previous entry. Defaults to `false`.
|
|
2411
2411
|
* @throws Throws error if the index is invalid or if removal fails.
|
|
2412
2412
|
*/
|
|
2413
2413
|
remove(i: number, rewritePreviousEntry?: boolean | undefined | null): void
|
|
@@ -2470,6 +2470,7 @@ export declare class Reflog {
|
|
|
2470
2470
|
* ```
|
|
2471
2471
|
*
|
|
2472
2472
|
* @returns Iterator over the reflog entries.
|
|
2473
|
+
* @throws Throws error if the reflog cannot be accessed.
|
|
2473
2474
|
*/
|
|
2474
2475
|
iter(): ReflogIter
|
|
2475
2476
|
/**
|
|
@@ -2544,7 +2545,7 @@ export declare class ReflogEntry {
|
|
|
2544
2545
|
* @signature
|
|
2545
2546
|
* ```ts
|
|
2546
2547
|
* class ReflogEntry {
|
|
2547
|
-
* message(): string
|
|
2548
|
+
* message(): string;
|
|
2548
2549
|
* }
|
|
2549
2550
|
* ```
|
|
2550
2551
|
*
|
|
@@ -4765,6 +4766,179 @@ export declare class Repository {
|
|
|
4765
4766
|
* @returns A container for a list of status information about a repository.
|
|
4766
4767
|
*/
|
|
4767
4768
|
statuses(): Statuses
|
|
4769
|
+
/**
|
|
4770
|
+
* Set up a new git submodule for checkout.
|
|
4771
|
+
*
|
|
4772
|
+
* This does "git submodule add" up to the fetch and checkout of the
|
|
4773
|
+
* submodule contents. It preps a new submodule, creates an entry in
|
|
4774
|
+
* `.gitmodules` and creates an empty initialized repository either at the
|
|
4775
|
+
* given path in the working directory or in `.git/modules` with a gitlink
|
|
4776
|
+
* from the working directory to the new repo.
|
|
4777
|
+
*
|
|
4778
|
+
* To fully emulate "git submodule add" call this function, then `open()`
|
|
4779
|
+
* the submodule repo and perform the clone step as needed. Lastly, call
|
|
4780
|
+
* `addFinalize()` to wrap up adding the new submodule and `.gitmodules`
|
|
4781
|
+
* to the index to be ready to commit.
|
|
4782
|
+
*
|
|
4783
|
+
* @category Repository/Methods
|
|
4784
|
+
* @signature
|
|
4785
|
+
* ```ts
|
|
4786
|
+
* class Repository {
|
|
4787
|
+
* submodule(
|
|
4788
|
+
* url: string,
|
|
4789
|
+
* path: string,
|
|
4790
|
+
* useGitlink?: boolean | null | undefined,
|
|
4791
|
+
* ): Submodule;
|
|
4792
|
+
* }
|
|
4793
|
+
* ```
|
|
4794
|
+
*
|
|
4795
|
+
* @param {string} url - URL for the submodule's remote.
|
|
4796
|
+
* @param {string} path - Path at which the submodule should be created.
|
|
4797
|
+
* @param {boolean} [useGitlink] - Should workdir contain a gitlink to the repo in
|
|
4798
|
+
* `.git/modules` vs. repo directly in workdir.
|
|
4799
|
+
*
|
|
4800
|
+
* @returns The submodule.
|
|
4801
|
+
*/
|
|
4802
|
+
submodule(url: string, path: string, useGitlink?: boolean | undefined | null): Submodule
|
|
4803
|
+
submodules(): Array<Submodule>
|
|
4804
|
+
/**
|
|
4805
|
+
* Lookup submodule information by name or path.
|
|
4806
|
+
*
|
|
4807
|
+
* Given either the submodule name or path (they are usually the same),
|
|
4808
|
+
* this returns a structure describing the submodule.
|
|
4809
|
+
*
|
|
4810
|
+
* @category Repository/Methods
|
|
4811
|
+
* @signature
|
|
4812
|
+
* ```ts
|
|
4813
|
+
* class Repository {
|
|
4814
|
+
* getSubmodule(name: string): Submodule;
|
|
4815
|
+
* }
|
|
4816
|
+
* ```
|
|
4817
|
+
*
|
|
4818
|
+
* @param {string} name - The name of or path to the submodule; trailing slashes okay.
|
|
4819
|
+
* @returns The submodule.
|
|
4820
|
+
* @throws If the submodule not found.
|
|
4821
|
+
*/
|
|
4822
|
+
getSubmodule(name: string): Submodule
|
|
4823
|
+
/**
|
|
4824
|
+
* Lookup submodule information by name or path.
|
|
4825
|
+
*
|
|
4826
|
+
* Given either the submodule name or path (they are usually the same),
|
|
4827
|
+
* this returns a structure describing the submodule.
|
|
4828
|
+
*
|
|
4829
|
+
* @category Repository/Methods
|
|
4830
|
+
* @signature
|
|
4831
|
+
* ```ts
|
|
4832
|
+
* class Repository {
|
|
4833
|
+
* findSubmodule(name: string): Submodule | null;
|
|
4834
|
+
* }
|
|
4835
|
+
* ```
|
|
4836
|
+
*
|
|
4837
|
+
* @param {string} name - The name of or path to the submodule; trailing slashes okay.
|
|
4838
|
+
* @returns The submodule. Returns `null` if the submodule is not found.
|
|
4839
|
+
*/
|
|
4840
|
+
findSubmodule(name: string): Submodule | null
|
|
4841
|
+
/**
|
|
4842
|
+
* Get the status for a submodule.
|
|
4843
|
+
*
|
|
4844
|
+
* This looks at a submodule and tries to determine the status. It
|
|
4845
|
+
* will return a combination of the `SubmoduleStatus` values.
|
|
4846
|
+
*
|
|
4847
|
+
* @category Repository/Methods
|
|
4848
|
+
* @signature
|
|
4849
|
+
* ```ts
|
|
4850
|
+
* class Repository {
|
|
4851
|
+
* submoduleStatus(name: string, ignore: SubmoduleIgnore): number;
|
|
4852
|
+
* }
|
|
4853
|
+
* ```
|
|
4854
|
+
*
|
|
4855
|
+
* @param {string} name - The name of the submodule.
|
|
4856
|
+
* @param {SubmoduleIgnore} ignore - The ignore rules to follow.
|
|
4857
|
+
* @returns The combination of the `SubmoduleStatus` values.
|
|
4858
|
+
*
|
|
4859
|
+
* @example
|
|
4860
|
+
* ```ts
|
|
4861
|
+
* import { openRepository, submoduleStatusContains, SubmoduleStatus } from 'es-git';
|
|
4862
|
+
*
|
|
4863
|
+
* const repo = await openRepository('...');
|
|
4864
|
+
* const status = repo.submoduleStatus('mysubmodule', 'None');
|
|
4865
|
+
*
|
|
4866
|
+
* console.log(
|
|
4867
|
+
* submoduleStatusContains(status, SubmoduleStatus.InHead | SubmoduleStatus.InIndex)
|
|
4868
|
+
* ); // true
|
|
4869
|
+
* ```
|
|
4870
|
+
*/
|
|
4871
|
+
submoduleStatus(name: string, ignore: SubmoduleIgnore): number
|
|
4872
|
+
/**
|
|
4873
|
+
* Set the ignore rule for the submodule in the configuration
|
|
4874
|
+
*
|
|
4875
|
+
* This does not affect any currently-loaded instances.
|
|
4876
|
+
*
|
|
4877
|
+
* @category Repository/Methods
|
|
4878
|
+
* @signature
|
|
4879
|
+
* ```ts
|
|
4880
|
+
* class Repository {
|
|
4881
|
+
* submoduleSetIgnore(name: string, ignore: SubmoduleIgnore): void;
|
|
4882
|
+
* }
|
|
4883
|
+
* ```
|
|
4884
|
+
*
|
|
4885
|
+
* @param {string} name - The name of the submodule.
|
|
4886
|
+
* @param {SubmoduleIgnore} ignore - The new value for the ignore rule.
|
|
4887
|
+
*/
|
|
4888
|
+
submoduleSetIgnore(name: string, ignore: SubmoduleIgnore): void
|
|
4889
|
+
/**
|
|
4890
|
+
* Set the update rule for the submodule in the configuration
|
|
4891
|
+
*
|
|
4892
|
+
* This setting won't affect any existing instances.
|
|
4893
|
+
*
|
|
4894
|
+
* @category Repository/Methods
|
|
4895
|
+
* @signature
|
|
4896
|
+
* ```ts
|
|
4897
|
+
* class Repository {
|
|
4898
|
+
* submoduleSetUpdate(name: string, update: SubmoduleUpdate): void;
|
|
4899
|
+
* }
|
|
4900
|
+
* ```
|
|
4901
|
+
*
|
|
4902
|
+
* @param {string} name - The name of the submodule.
|
|
4903
|
+
* @param {SubmoduleUpdate} update - The new value to use.
|
|
4904
|
+
*/
|
|
4905
|
+
submoduleSetUpdate(name: string, update: SubmoduleUpdate): void
|
|
4906
|
+
/**
|
|
4907
|
+
* Set the URL for the submodule in the configuration
|
|
4908
|
+
*
|
|
4909
|
+
* After calling this, you may wish to call `Submodule#sync()` to write
|
|
4910
|
+
* the changes to the checked out submodule repository.
|
|
4911
|
+
*
|
|
4912
|
+
* @category Repository/Methods
|
|
4913
|
+
* @signature
|
|
4914
|
+
* ```ts
|
|
4915
|
+
* class Repository {
|
|
4916
|
+
* submoduleSetUrl(name: string, url: string): void;
|
|
4917
|
+
* }
|
|
4918
|
+
* ```
|
|
4919
|
+
*
|
|
4920
|
+
* @param {string} name - The name of the submodule to configure.
|
|
4921
|
+
* @param {string} url - URL that should be used for the submodule.
|
|
4922
|
+
*/
|
|
4923
|
+
submoduleSetUrl(name: string, url: string): void
|
|
4924
|
+
/**
|
|
4925
|
+
* Set the branch for the submodule in the configuration
|
|
4926
|
+
*
|
|
4927
|
+
* After calling this, you may wish to call `Submodule#sync()` to write
|
|
4928
|
+
* the changes to the checked out submodule repository.
|
|
4929
|
+
*
|
|
4930
|
+
* @category Repository/Methods
|
|
4931
|
+
* @signature
|
|
4932
|
+
* ```ts
|
|
4933
|
+
* class Repository {
|
|
4934
|
+
* submoduleSetBranch(name: string, branchName: string): void;
|
|
4935
|
+
* }
|
|
4936
|
+
* ```
|
|
4937
|
+
*
|
|
4938
|
+
* @param {string} name - The name of the submodule to configure.
|
|
4939
|
+
* @param {string} branchName - Branch that should be used for the submodule
|
|
4940
|
+
*/
|
|
4941
|
+
submoduleSetBranch(name: string, branchName: string): void
|
|
4768
4942
|
/**
|
|
4769
4943
|
* Lookup a tag object by prefix hash from the repository.
|
|
4770
4944
|
*
|
|
@@ -5565,6 +5739,325 @@ export declare class StatusesIter extends Iterator<StatusEntry, void, void> {
|
|
|
5565
5739
|
next(value?: void): IteratorResult<StatusEntry, void>
|
|
5566
5740
|
}
|
|
5567
5741
|
|
|
5742
|
+
export declare class Submodule {
|
|
5743
|
+
/**
|
|
5744
|
+
* Get the name for the submodule.
|
|
5745
|
+
*
|
|
5746
|
+
* @category Submodule/Methods
|
|
5747
|
+
* @signature
|
|
5748
|
+
* ```ts
|
|
5749
|
+
* class Submodule {
|
|
5750
|
+
* name(): string;
|
|
5751
|
+
* }
|
|
5752
|
+
* ```
|
|
5753
|
+
*/
|
|
5754
|
+
name(): string
|
|
5755
|
+
/**
|
|
5756
|
+
* Get the submodule's branch.
|
|
5757
|
+
* ule/Methods
|
|
5758
|
+
* @signature
|
|
5759
|
+
* ```ts
|
|
5760
|
+
* class Submodule {
|
|
5761
|
+
* branch(): string | null;
|
|
5762
|
+
* }
|
|
5763
|
+
* ```
|
|
5764
|
+
* @returns The branch name of the submodule. Returns `null` if the branch if the branch is
|
|
5765
|
+
* not yet available.
|
|
5766
|
+
*/
|
|
5767
|
+
branch(): string | null
|
|
5768
|
+
/**
|
|
5769
|
+
* Get the submodule's URL.
|
|
5770
|
+
*
|
|
5771
|
+
* @category Submodule/Methods
|
|
5772
|
+
* @signature
|
|
5773
|
+
* ```ts
|
|
5774
|
+
* class Submodule {
|
|
5775
|
+
* url(): string | null;
|
|
5776
|
+
* }
|
|
5777
|
+
* ```
|
|
5778
|
+
*
|
|
5779
|
+
* @returns The URL of the submodule. Returns `null` if the URL isn't present.
|
|
5780
|
+
*/
|
|
5781
|
+
url(): string | null
|
|
5782
|
+
/**
|
|
5783
|
+
* Get the path for the submodule.
|
|
5784
|
+
*
|
|
5785
|
+
* @category Submodule/Methods
|
|
5786
|
+
* @signature
|
|
5787
|
+
* ```ts
|
|
5788
|
+
* class Submodule {
|
|
5789
|
+
* path(): string;
|
|
5790
|
+
* }
|
|
5791
|
+
* ```
|
|
5792
|
+
*
|
|
5793
|
+
* @returns The path for the submodule.
|
|
5794
|
+
*/
|
|
5795
|
+
path(): string
|
|
5796
|
+
/**
|
|
5797
|
+
* Get the OID for the submodule in the current `HEAD` tree.
|
|
5798
|
+
*
|
|
5799
|
+
* @category Submodule/Methods
|
|
5800
|
+
* @signature
|
|
5801
|
+
* ```ts
|
|
5802
|
+
* class Submodule {
|
|
5803
|
+
* headId(): string | null;
|
|
5804
|
+
* }
|
|
5805
|
+
* ```
|
|
5806
|
+
*
|
|
5807
|
+
* @returns The OID for the submodule in the current `HEAD` tree.
|
|
5808
|
+
*/
|
|
5809
|
+
headId(): string | null
|
|
5810
|
+
/**
|
|
5811
|
+
* Get the OID for the submodule in the index.
|
|
5812
|
+
*
|
|
5813
|
+
* @category Submodule/Methods
|
|
5814
|
+
* @signature
|
|
5815
|
+
* ```ts
|
|
5816
|
+
* class Submodule {
|
|
5817
|
+
* indexId(): string | null;
|
|
5818
|
+
* }
|
|
5819
|
+
* ```
|
|
5820
|
+
*
|
|
5821
|
+
* @returns The OID for the submodule in the index.
|
|
5822
|
+
*/
|
|
5823
|
+
indexId(): string | null
|
|
5824
|
+
/**
|
|
5825
|
+
* Get the OID for the submodule in the current working directory.
|
|
5826
|
+
*
|
|
5827
|
+
* This returns the OID that corresponds to looking up `HEAD` in the
|
|
5828
|
+
* checked out submodule. If there are pending changes in the index or
|
|
5829
|
+
* anything else, this won't notice that.
|
|
5830
|
+
*
|
|
5831
|
+
* @category Submodule/Methods
|
|
5832
|
+
* @signature
|
|
5833
|
+
* ```ts
|
|
5834
|
+
* class Submodule {
|
|
5835
|
+
* workdirId(): string | null;
|
|
5836
|
+
* }
|
|
5837
|
+
* ```
|
|
5838
|
+
*
|
|
5839
|
+
* @returns The OID for the submodule in the current working directory.
|
|
5840
|
+
*/
|
|
5841
|
+
workdirId(): string | null
|
|
5842
|
+
/**
|
|
5843
|
+
* Get the ignore rule that will be used for the submodule.
|
|
5844
|
+
*
|
|
5845
|
+
* @category Submodule/Methods
|
|
5846
|
+
* @signature
|
|
5847
|
+
* ```ts
|
|
5848
|
+
* class Submodule {
|
|
5849
|
+
* ignoreRule(): SubmoduleIgnore;
|
|
5850
|
+
* }
|
|
5851
|
+
* ```
|
|
5852
|
+
*
|
|
5853
|
+
* @returns The ignore rule that will be used for the submodule.
|
|
5854
|
+
*/
|
|
5855
|
+
ignoreRule(): SubmoduleIgnore
|
|
5856
|
+
/**
|
|
5857
|
+
* Get the update rule that will be used for the submodule.
|
|
5858
|
+
*
|
|
5859
|
+
* @category Submodule/Methods
|
|
5860
|
+
* @signature
|
|
5861
|
+
* ```ts
|
|
5862
|
+
* class Submodule {
|
|
5863
|
+
* updateStrategy(): SubmoduleUpdate;
|
|
5864
|
+
* }
|
|
5865
|
+
* ```
|
|
5866
|
+
*
|
|
5867
|
+
* @returns The update rule that will be used for the submodule.
|
|
5868
|
+
*/
|
|
5869
|
+
updateStrategy(): SubmoduleUpdate
|
|
5870
|
+
/**
|
|
5871
|
+
* Copy submodule info into ".git/config" file.
|
|
5872
|
+
*
|
|
5873
|
+
* Just like "git submodule init", this copies information about the
|
|
5874
|
+
* submodule into ".git/config". You can use the accessor functions above
|
|
5875
|
+
* to alter the in-memory git_submodule object and control what is written
|
|
5876
|
+
* to the config, overriding what is in .gitmodules.
|
|
5877
|
+
*
|
|
5878
|
+
* By default, existing entries will not be overwritten, but passing `true`
|
|
5879
|
+
* for `overwrite` forces them to be updated.
|
|
5880
|
+
*
|
|
5881
|
+
* @category Submodule/Methods
|
|
5882
|
+
* @signature
|
|
5883
|
+
* ```ts
|
|
5884
|
+
* class Submodule {
|
|
5885
|
+
* init(
|
|
5886
|
+
* overwrite?: boolean | null | undefined,
|
|
5887
|
+
* signal?: AbortSignal | null | undefined,
|
|
5888
|
+
* ): Promise<void>;
|
|
5889
|
+
* }
|
|
5890
|
+
* ```
|
|
5891
|
+
*
|
|
5892
|
+
* @param {boolean} [overwrite] - By default, existing entries will not be overwritten, but
|
|
5893
|
+
* setting this to true forces them to be updated.
|
|
5894
|
+
* @param {AbortSignal} [signal] - Optional AbortSignal to cancel the operation.
|
|
5895
|
+
*/
|
|
5896
|
+
init(overwrite?: boolean | undefined | null, signal?: AbortSignal | undefined | null): Promise<void>
|
|
5897
|
+
/**
|
|
5898
|
+
* Set up the subrepository for a submodule in preparation for clone.
|
|
5899
|
+
*
|
|
5900
|
+
* This function can be called to init and set up a submodule repository
|
|
5901
|
+
* from a submodule in preparation to clone it from its remote.
|
|
5902
|
+
*
|
|
5903
|
+
* @category Submodule/Methods
|
|
5904
|
+
* @signature
|
|
5905
|
+
* ```ts
|
|
5906
|
+
* class Submodule {
|
|
5907
|
+
* repoInit(
|
|
5908
|
+
* useGitlink?: boolean | null | undefined,
|
|
5909
|
+
* signal?: AbortSignal | null | undefined,
|
|
5910
|
+
* ): Promise<Repository>;
|
|
5911
|
+
* }
|
|
5912
|
+
* ```
|
|
5913
|
+
*
|
|
5914
|
+
* @param {boolean} [useGitlink] - Should the workdir contain a gitlink to the repo in
|
|
5915
|
+
* `.git/modules` vs. repo directly in workdir.
|
|
5916
|
+
* @param {AbortSignal} [signal] - Optional AbortSignal to cancel the operation.
|
|
5917
|
+
*
|
|
5918
|
+
* @returns The repository.
|
|
5919
|
+
*/
|
|
5920
|
+
repoInit(useGitlink?: boolean | undefined | null, signal?: AbortSignal | undefined | null): Promise<Repository>
|
|
5921
|
+
/**
|
|
5922
|
+
* Open the repository for a submodule.
|
|
5923
|
+
*
|
|
5924
|
+
* This will only work if the submodule is checked out into the working
|
|
5925
|
+
* directory.
|
|
5926
|
+
*
|
|
5927
|
+
* @category Submodule/Methods
|
|
5928
|
+
* @signature
|
|
5929
|
+
* ```ts
|
|
5930
|
+
* class Submodule {
|
|
5931
|
+
* open(signal?: AbortSignal | null | undefined): Promise<Repository>;
|
|
5932
|
+
* }
|
|
5933
|
+
* ```
|
|
5934
|
+
*
|
|
5935
|
+
* @param {AbortSignal} [signal] - Optional AbortSignal to cancel the operation.
|
|
5936
|
+
* @returns The repository.
|
|
5937
|
+
*/
|
|
5938
|
+
open(signal?: AbortSignal | undefined | null): Promise<Repository>
|
|
5939
|
+
/**
|
|
5940
|
+
* Reread submodule info from config, index, and `HEAD`.
|
|
5941
|
+
*
|
|
5942
|
+
* Call this to reread cached submodule information for this submodule if
|
|
5943
|
+
* you have reason to believe that it has changed.
|
|
5944
|
+
*
|
|
5945
|
+
* @category Submodule/Methods
|
|
5946
|
+
* @signature
|
|
5947
|
+
* ```ts
|
|
5948
|
+
* class Submodule {
|
|
5949
|
+
* reload(
|
|
5950
|
+
* force?: boolean | null | undefined,
|
|
5951
|
+
* signal?: AbortSignal | null | undefined,
|
|
5952
|
+
* ): Promise<void>;
|
|
5953
|
+
* }
|
|
5954
|
+
* ```
|
|
5955
|
+
*
|
|
5956
|
+
* @param {boolean} [force] - If this is `true`, then data will be reloaded even if it
|
|
5957
|
+
* doesn't seem out of date.
|
|
5958
|
+
* @param {AbortSignal} [signal] - Optional AbortSignal to cancel the operation.
|
|
5959
|
+
*/
|
|
5960
|
+
reload(force?: boolean | undefined | null, signal?: AbortSignal | undefined | null): Promise<void>
|
|
5961
|
+
/**
|
|
5962
|
+
* Copy submodule remote info into submodule repo.
|
|
5963
|
+
*
|
|
5964
|
+
* This copies the information about the submodules URL into the checked
|
|
5965
|
+
* out submodule config, acting like "git submodule sync". This is useful
|
|
5966
|
+
* if you have altered the URL for the submodule (or it has been altered
|
|
5967
|
+
* by a fetch of upstream changes) and you need to update your local repo.
|
|
5968
|
+
*
|
|
5969
|
+
* @category Submodule/Methods
|
|
5970
|
+
* @signature
|
|
5971
|
+
* ```ts
|
|
5972
|
+
* class Submodule {
|
|
5973
|
+
* sync(signal?: AbortSignal | null | undefined): Promise<void>;
|
|
5974
|
+
* }
|
|
5975
|
+
* ```
|
|
5976
|
+
*
|
|
5977
|
+
* @param {AbortSignal} [signal] - Optional AbortSignal to cancel the operation.
|
|
5978
|
+
*/
|
|
5979
|
+
sync(signal?: AbortSignal | undefined | null): Promise<void>
|
|
5980
|
+
/**
|
|
5981
|
+
* Add current submodule HEAD commit to index of superproject.
|
|
5982
|
+
*
|
|
5983
|
+
* @category Submodule/Methods
|
|
5984
|
+
* @signature
|
|
5985
|
+
* ```ts
|
|
5986
|
+
* class Submodule {
|
|
5987
|
+
* addToIndex(writeIndex?: boolean | null | undefined): void;
|
|
5988
|
+
* }
|
|
5989
|
+
* ```
|
|
5990
|
+
*
|
|
5991
|
+
* @param {boolean} [writeIndex] - If is true, then the index file will be immediately written.
|
|
5992
|
+
* Otherwise, you must explicitly call `write()` on an `Index` later on.
|
|
5993
|
+
*/
|
|
5994
|
+
addToIndex(writeIndex?: boolean | undefined | null): void
|
|
5995
|
+
/**
|
|
5996
|
+
* Resolve the setup of a new git submodule.
|
|
5997
|
+
*
|
|
5998
|
+
* This should be called on a submodule once you have called add setup and
|
|
5999
|
+
* done the clone of the submodule. This adds the `.gitmodules` file and the
|
|
6000
|
+
* newly cloned submodule to the index to be ready to be committed (but
|
|
6001
|
+
* doesn't actually do the commit).
|
|
6002
|
+
*
|
|
6003
|
+
* @category Submodule/Methods
|
|
6004
|
+
* @signature
|
|
6005
|
+
* ```ts
|
|
6006
|
+
* class Submodule {
|
|
6007
|
+
* addFinalize(): void;
|
|
6008
|
+
* }
|
|
6009
|
+
* ```
|
|
6010
|
+
*/
|
|
6011
|
+
addFinalize(): void
|
|
6012
|
+
/**
|
|
6013
|
+
* Update submodule.
|
|
6014
|
+
*
|
|
6015
|
+
* This will clone a missing submodule and check out the subrepository to
|
|
6016
|
+
* the commit specified in the index of the containing repository. If
|
|
6017
|
+
* the submodule repository doesn't contain the target commit, then the
|
|
6018
|
+
* submodule is fetched using the fetch options supplied in options.
|
|
6019
|
+
*
|
|
6020
|
+
* @category Submodule/Methods
|
|
6021
|
+
* @signature
|
|
6022
|
+
* ```ts
|
|
6023
|
+
* class Submodule {
|
|
6024
|
+
* update(
|
|
6025
|
+
* init?: boolean | null | undefined,
|
|
6026
|
+
* options?: SubmoduleUpdateOptions | null | undefined,
|
|
6027
|
+
* signal?: AbortSignal | null | undefined,
|
|
6028
|
+
* ): Promise<void>;
|
|
6029
|
+
* }
|
|
6030
|
+
* ```
|
|
6031
|
+
*
|
|
6032
|
+
* @param {boolean} [init] - Indicates if the submodule should be initialized first if it has
|
|
6033
|
+
* not been initialized yet.
|
|
6034
|
+
* @param {SubmoduleUpdateOptions} [options] - Configuration options for the update.
|
|
6035
|
+
* @param {AbortSignal} [signal] - Optional AbortSignal to cancel the operation.
|
|
6036
|
+
*/
|
|
6037
|
+
update(init?: boolean | undefined | null, options?: SubmoduleUpdateOptions | undefined | null, signal?: AbortSignal | undefined | null): Promise<void>
|
|
6038
|
+
/**
|
|
6039
|
+
* Perform the clone step for a newly created submodule.
|
|
6040
|
+
*
|
|
6041
|
+
* This performs the necessary `git clone` to setup a newly-created submodule.
|
|
6042
|
+
*
|
|
6043
|
+
* @category Submodule/Methods
|
|
6044
|
+
* @signature
|
|
6045
|
+
* ```ts
|
|
6046
|
+
* class Submodule {
|
|
6047
|
+
* clone(
|
|
6048
|
+
* options?: SubmoduleUpdateOptions | null | undefined,
|
|
6049
|
+
* signal?: AbortSignal | null | undefined,
|
|
6050
|
+
* ): Promise<Repository>;
|
|
6051
|
+
* }
|
|
6052
|
+
* ```
|
|
6053
|
+
*
|
|
6054
|
+
* @param {SubmoduleUpdateOptions} [options] - The options to use.
|
|
6055
|
+
* @param {AbortSignal} [signal] - Optional AbortSignal to cancel the operation.
|
|
6056
|
+
* @returns The newly created repository object.
|
|
6057
|
+
*/
|
|
6058
|
+
clone(options?: SubmoduleUpdateOptions | undefined | null, signal?: AbortSignal | undefined | null): Promise<Repository>
|
|
6059
|
+
}
|
|
6060
|
+
|
|
5568
6061
|
/**
|
|
5569
6062
|
* A class to represent a git [tag][1].
|
|
5570
6063
|
*
|
|
@@ -8304,6 +8797,145 @@ export type StatusShow = 'Index'|
|
|
|
8304
8797
|
'Workdir'|
|
|
8305
8798
|
'IndexAndWorkdir';
|
|
8306
8799
|
|
|
8800
|
+
/**
|
|
8801
|
+
* Submodule ignore values
|
|
8802
|
+
*
|
|
8803
|
+
* These values represent settings for the `submodule.$name.ignore`
|
|
8804
|
+
* configuration value which says how deeply to look at the working
|
|
8805
|
+
* directory when getting the submodule status.
|
|
8806
|
+
*/
|
|
8807
|
+
export type SubmoduleIgnore = /** Use the submodule's configuration */
|
|
8808
|
+
'Unspecified'|
|
|
8809
|
+
/** Any change or untracked file is considered dirty */
|
|
8810
|
+
'None'|
|
|
8811
|
+
/** Only dirty if tracked files have changed */
|
|
8812
|
+
'Untracked'|
|
|
8813
|
+
/** Only dirty if HEAD has moved */
|
|
8814
|
+
'Dirty'|
|
|
8815
|
+
/** Never dirty */
|
|
8816
|
+
'All';
|
|
8817
|
+
|
|
8818
|
+
/**
|
|
8819
|
+
* Return codes for submodule status.
|
|
8820
|
+
*
|
|
8821
|
+
* A combination of these flags will be returned to describe the status of a
|
|
8822
|
+
* submodule. Depending on the "ignore" property of the submodule, some of
|
|
8823
|
+
* the flags may never be returned because they indicate changes that are
|
|
8824
|
+
* supposed to be ignored.
|
|
8825
|
+
*
|
|
8826
|
+
* Submodule info is contained in 4 places: the HEAD tree, the index, config
|
|
8827
|
+
* files (both .git/config and .gitmodules), and the working directory. Any
|
|
8828
|
+
* or all of those places might be missing information about the submodule
|
|
8829
|
+
* depending on what state the repo is in. We consider all four places to
|
|
8830
|
+
* build the combination of status flags.
|
|
8831
|
+
*
|
|
8832
|
+
* There are four values that are not really status, but give basic info
|
|
8833
|
+
* about what sources of submodule data are available. These will be
|
|
8834
|
+
* returned even if ignore is set to "ALL".
|
|
8835
|
+
*
|
|
8836
|
+
* * IN_HEAD - superproject head contains submodule
|
|
8837
|
+
* * IN_INDEX - superproject index contains submodule
|
|
8838
|
+
* * IN_CONFIG - superproject gitmodules has submodule
|
|
8839
|
+
* * IN_WD - superproject workdir has submodule
|
|
8840
|
+
*
|
|
8841
|
+
* The following values will be returned so long as ignore is not "ALL".
|
|
8842
|
+
*
|
|
8843
|
+
* * INDEX_ADDED - in index, not in head
|
|
8844
|
+
* * INDEX_DELETED - in head, not in index
|
|
8845
|
+
* * INDEX_MODIFIED - index and head don't match
|
|
8846
|
+
* * WD_UNINITIALIZED - workdir contains empty directory
|
|
8847
|
+
* * WD_ADDED - in workdir, not index
|
|
8848
|
+
* * WD_DELETED - in index, not workdir
|
|
8849
|
+
* * WD_MODIFIED - index and workdir head don't match
|
|
8850
|
+
*
|
|
8851
|
+
* The following can only be returned if ignore is "NONE" or "UNTRACKED".
|
|
8852
|
+
*
|
|
8853
|
+
* * WD_INDEX_MODIFIED - submodule workdir index is dirty
|
|
8854
|
+
* * WD_WD_MODIFIED - submodule workdir has modified files
|
|
8855
|
+
*
|
|
8856
|
+
* Lastly, the following will only be returned for ignore "NONE".
|
|
8857
|
+
*
|
|
8858
|
+
* * WD_UNTRACKED - workdir contains untracked files
|
|
8859
|
+
*/
|
|
8860
|
+
export declare enum SubmoduleStatus {
|
|
8861
|
+
InHead = 1,
|
|
8862
|
+
InIndex = 2,
|
|
8863
|
+
InConfig = 4,
|
|
8864
|
+
InWD = 8,
|
|
8865
|
+
IndexAdded = 16,
|
|
8866
|
+
IndexDeleted = 32,
|
|
8867
|
+
IndexModified = 64,
|
|
8868
|
+
WDUninitialized = 128,
|
|
8869
|
+
WDAdded = 256,
|
|
8870
|
+
WDDeleted = 512,
|
|
8871
|
+
WDModified = 1024,
|
|
8872
|
+
WDIndexModified = 2048,
|
|
8873
|
+
WDWDModified = 4096,
|
|
8874
|
+
WDUntracked = 8192
|
|
8875
|
+
}
|
|
8876
|
+
|
|
8877
|
+
/**
|
|
8878
|
+
* Check submodule status contains given value.
|
|
8879
|
+
*
|
|
8880
|
+
* @category Submodule
|
|
8881
|
+
* @signature
|
|
8882
|
+
* ```ts
|
|
8883
|
+
* function submoduleStatusContains(source: number, target: number): boolean;
|
|
8884
|
+
* ```
|
|
8885
|
+
*
|
|
8886
|
+
* @param {number} source - Source status.
|
|
8887
|
+
* @param {number} target - Target status.
|
|
8888
|
+
* @returns Returns `true` is source status contains target status.
|
|
8889
|
+
*/
|
|
8890
|
+
export declare function submoduleStatusContains(source: number, target: number): boolean
|
|
8891
|
+
|
|
8892
|
+
/**
|
|
8893
|
+
* Submodule update values
|
|
8894
|
+
*
|
|
8895
|
+
* These values represent settings for the `submodule.$name.update`
|
|
8896
|
+
* configuration value which says how to handle `git submodule update`
|
|
8897
|
+
* for this submodule. The value is usually set in the ".gitmodules"
|
|
8898
|
+
* file and copied to ".git/config" when the submodule is initialized.
|
|
8899
|
+
*/
|
|
8900
|
+
export type SubmoduleUpdate = /**
|
|
8901
|
+
* The default; when a submodule is updated| checkout the new detached
|
|
8902
|
+
* HEAD to the submodule directory.
|
|
8903
|
+
*/
|
|
8904
|
+
'Checkout'|
|
|
8905
|
+
/**
|
|
8906
|
+
* Update by rebasing the current checked out branch onto the commit from
|
|
8907
|
+
* the superproject.
|
|
8908
|
+
*/
|
|
8909
|
+
'Rebase'|
|
|
8910
|
+
/**
|
|
8911
|
+
* Update by merging the commit in the superproject into the current
|
|
8912
|
+
* checkout out branch of the submodule.
|
|
8913
|
+
*/
|
|
8914
|
+
'Merge'|
|
|
8915
|
+
/**
|
|
8916
|
+
* Do not update this submodule even when the commit in the superproject
|
|
8917
|
+
* is updated.
|
|
8918
|
+
*/
|
|
8919
|
+
'None'|
|
|
8920
|
+
/**
|
|
8921
|
+
* Not used except as static initializer when we don't want any particular
|
|
8922
|
+
* update rule to be specified.
|
|
8923
|
+
*/
|
|
8924
|
+
'Default';
|
|
8925
|
+
|
|
8926
|
+
/** Options to update a submodule. */
|
|
8927
|
+
export interface SubmoduleUpdateOptions {
|
|
8928
|
+
/** These options are passed to the checkout step. */
|
|
8929
|
+
checkout?: CheckoutOptions
|
|
8930
|
+
/** Options which control the fetch, including callbacks. */
|
|
8931
|
+
fetch?: FetchOptions
|
|
8932
|
+
/**
|
|
8933
|
+
* Allow fetching from the submodule's default remote if the target commit isn't found.
|
|
8934
|
+
* Default: `true`.
|
|
8935
|
+
*/
|
|
8936
|
+
allowFetch?: boolean
|
|
8937
|
+
}
|
|
8938
|
+
|
|
8307
8939
|
/**
|
|
8308
8940
|
* Clear the global subscriber
|
|
8309
8941
|
*
|
package/index.js
CHANGED
|
@@ -608,6 +608,7 @@ module.exports.StashListIter = nativeBinding.StashListIter
|
|
|
608
608
|
module.exports.StatusEntry = nativeBinding.StatusEntry
|
|
609
609
|
module.exports.Statuses = nativeBinding.Statuses
|
|
610
610
|
module.exports.StatusesIter = nativeBinding.StatusesIter
|
|
611
|
+
module.exports.Submodule = nativeBinding.Submodule
|
|
611
612
|
module.exports.Tag = nativeBinding.Tag
|
|
612
613
|
module.exports.Tree = nativeBinding.Tree
|
|
613
614
|
module.exports.TreeEntry = nativeBinding.TreeEntry
|
|
@@ -659,6 +660,10 @@ module.exports.RevparseMode = nativeBinding.RevparseMode
|
|
|
659
660
|
module.exports.revparseModeContains = nativeBinding.revparseModeContains
|
|
660
661
|
module.exports.RevwalkSort = nativeBinding.RevwalkSort
|
|
661
662
|
module.exports.StatusShow = nativeBinding.StatusShow
|
|
663
|
+
module.exports.SubmoduleIgnore = nativeBinding.SubmoduleIgnore
|
|
664
|
+
module.exports.SubmoduleStatus = nativeBinding.SubmoduleStatus
|
|
665
|
+
module.exports.submoduleStatusContains = nativeBinding.submoduleStatusContains
|
|
666
|
+
module.exports.SubmoduleUpdate = nativeBinding.SubmoduleUpdate
|
|
662
667
|
module.exports.traceClear = nativeBinding.traceClear
|
|
663
668
|
module.exports.TraceLevel = nativeBinding.TraceLevel
|
|
664
669
|
module.exports.traceSet = nativeBinding.traceSet
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "es-git",
|
|
3
|
-
"version": "0.5.0-next.
|
|
3
|
+
"version": "0.5.0-next.172+1b12e25",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"types": "index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -54,15 +54,15 @@
|
|
|
54
54
|
"vitest": "^3.0.5"
|
|
55
55
|
},
|
|
56
56
|
"optionalDependencies": {
|
|
57
|
-
"es-git-darwin-x64": "0.5.0-next.
|
|
58
|
-
"es-git-darwin-arm64": "0.5.0-next.
|
|
59
|
-
"es-git-win32-x64-msvc": "0.5.0-next.
|
|
60
|
-
"es-git-win32-arm64-msvc": "0.5.0-next.
|
|
61
|
-
"es-git-linux-x64-gnu": "0.5.0-next.
|
|
62
|
-
"es-git-linux-x64-musl": "0.5.0-next.
|
|
63
|
-
"es-git-android-arm64": "0.5.0-next.
|
|
64
|
-
"es-git-linux-arm64-gnu": "0.5.0-next.
|
|
65
|
-
"es-git-linux-arm64-musl": "0.5.0-next.
|
|
66
|
-
"es-git-android-arm-eabi": "0.5.0-next.
|
|
57
|
+
"es-git-darwin-x64": "0.5.0-next.172+1b12e25",
|
|
58
|
+
"es-git-darwin-arm64": "0.5.0-next.172+1b12e25",
|
|
59
|
+
"es-git-win32-x64-msvc": "0.5.0-next.172+1b12e25",
|
|
60
|
+
"es-git-win32-arm64-msvc": "0.5.0-next.172+1b12e25",
|
|
61
|
+
"es-git-linux-x64-gnu": "0.5.0-next.172+1b12e25",
|
|
62
|
+
"es-git-linux-x64-musl": "0.5.0-next.172+1b12e25",
|
|
63
|
+
"es-git-android-arm64": "0.5.0-next.172+1b12e25",
|
|
64
|
+
"es-git-linux-arm64-gnu": "0.5.0-next.172+1b12e25",
|
|
65
|
+
"es-git-linux-arm64-musl": "0.5.0-next.172+1b12e25",
|
|
66
|
+
"es-git-android-arm-eabi": "0.5.0-next.172+1b12e25"
|
|
67
67
|
}
|
|
68
68
|
}
|