es-git 0.5.0-next.164 → 0.5.0-next.166
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 +143 -36
- package/package.json +11 -11
package/index.d.ts
CHANGED
|
@@ -1464,6 +1464,23 @@ export declare class DiffStats {
|
|
|
1464
1464
|
* [1]: https://git-scm.com/book/en/Git-Internals-Git-Objects
|
|
1465
1465
|
*/
|
|
1466
1466
|
export declare class GitObject {
|
|
1467
|
+
/**
|
|
1468
|
+
* Describes a commit
|
|
1469
|
+
*
|
|
1470
|
+
* Performs a describe operation on this commitish object.
|
|
1471
|
+
*
|
|
1472
|
+
* @category GitObject/Methods
|
|
1473
|
+
* @signature
|
|
1474
|
+
* ```ts
|
|
1475
|
+
* class Object {
|
|
1476
|
+
* describe(options?: DescribeOptions | null | undefined): Describe;
|
|
1477
|
+
* }
|
|
1478
|
+
* ```
|
|
1479
|
+
*
|
|
1480
|
+
* @param {DescribeOptions} [options] - Options for describe operation.
|
|
1481
|
+
* @returns Instance of describe.
|
|
1482
|
+
*/
|
|
1483
|
+
describe(options?: DescribeOptions | undefined | null): Describe
|
|
1467
1484
|
/**
|
|
1468
1485
|
* Get the id (SHA1) of a repository object.
|
|
1469
1486
|
*
|
|
@@ -1552,23 +1569,6 @@ export declare class GitObject {
|
|
|
1552
1569
|
* @returns Returns `null` if the object is not actually a commit.
|
|
1553
1570
|
*/
|
|
1554
1571
|
asCommit(): Commit | null
|
|
1555
|
-
/**
|
|
1556
|
-
* Describes a commit
|
|
1557
|
-
*
|
|
1558
|
-
* Performs a describe operation on this commitish object.
|
|
1559
|
-
*
|
|
1560
|
-
* @category GitObject/Methods
|
|
1561
|
-
* @signature
|
|
1562
|
-
* ```ts
|
|
1563
|
-
* class Object {
|
|
1564
|
-
* describe(options?: DescribeOptions | null | undefined): Describe;
|
|
1565
|
-
* }
|
|
1566
|
-
* ```
|
|
1567
|
-
*
|
|
1568
|
-
* @param {DescribeOptions} [options] - Options for describe operation.
|
|
1569
|
-
* @returns Instance of describe.
|
|
1570
|
-
*/
|
|
1571
|
-
describe(options?: DescribeOptions | undefined | null): Describe
|
|
1572
1572
|
}
|
|
1573
1573
|
|
|
1574
1574
|
/**
|
|
@@ -2800,6 +2800,98 @@ export declare class Repository {
|
|
|
2800
2800
|
* @param {CheckoutOptions} [options] - Options for checkout.
|
|
2801
2801
|
*/
|
|
2802
2802
|
checkoutTree(treeish: GitObject, options?: CheckoutOptions | undefined | null): void
|
|
2803
|
+
/**
|
|
2804
|
+
* Cherrypicks the given commit onto HEAD and updates the working tree and index.
|
|
2805
|
+
* This method prepares the index and tree as if the commit were applied, but does not actually make a new commit.
|
|
2806
|
+
*
|
|
2807
|
+
* @category Repository/Methods
|
|
2808
|
+
* @signature
|
|
2809
|
+
* ```ts
|
|
2810
|
+
* class Repository {
|
|
2811
|
+
* cherrypick(
|
|
2812
|
+
* commit: Commit,
|
|
2813
|
+
* options?: CherrypickOptions | undefined | null,
|
|
2814
|
+
* ): void;
|
|
2815
|
+
* }
|
|
2816
|
+
* ```
|
|
2817
|
+
*
|
|
2818
|
+
* @param {Commit} commit - The commit to cherrypick.
|
|
2819
|
+
* @param {CherrypickOptions} [options] - Options for the cherrypick operation.
|
|
2820
|
+
* @throws {Error} If the commit is a merge commit and no mainline is specified.
|
|
2821
|
+
* @throws {Error} If there are conflicts during the cherrypick operation.
|
|
2822
|
+
*
|
|
2823
|
+
* @example
|
|
2824
|
+
* ```ts
|
|
2825
|
+
* import { openRepository } from 'es-git';
|
|
2826
|
+
*
|
|
2827
|
+
* const repo = await openRepository('./path/to/repo');
|
|
2828
|
+
* const cherrypickCommit = repo.getCommit('cherrypick-commit');
|
|
2829
|
+
*
|
|
2830
|
+
* // Cherrypick the commit onto HEAD and working tree
|
|
2831
|
+
* repo.cherrypick(cherrypickCommit);
|
|
2832
|
+
* repo.cleanupState();
|
|
2833
|
+
*
|
|
2834
|
+
* // Cherrypick the commit against our commit selecting the first parent as mainline (This is necessary because, for merge commits, there is ambiguity about which side of the merge should be treated as the baseline.)
|
|
2835
|
+
* repo.cherrypick(cherrypickCommit, { mainline: 1 });
|
|
2836
|
+
* repo.cleanupState();
|
|
2837
|
+
*
|
|
2838
|
+
* // Prevent working tree changes (dry run) but compute conflicts
|
|
2839
|
+
* repo.cherrypick(cherrypickCommit, { checkoutOptions: { dryRun: true } });
|
|
2840
|
+
* repo.cleanupState();
|
|
2841
|
+
*
|
|
2842
|
+
* // Cherrypick the commit against our commit selecting the first parent as mainline and prevent working tree changes (dry run) but compute conflicts
|
|
2843
|
+
* repo.cherrypick(cherrypickCommit, { mainline: 1, checkoutOptions: { dryRun: true } });
|
|
2844
|
+
* repo.cleanupState();
|
|
2845
|
+
* ```
|
|
2846
|
+
*/
|
|
2847
|
+
cherrypick(commit: Commit, options?: CherrypickOptions | undefined | null): void
|
|
2848
|
+
/**
|
|
2849
|
+
* Applies a cherrypick of `cherrypick_commit` against `our_commit` and returns the resulting Index,
|
|
2850
|
+
* without modifying the working directory or repository state.
|
|
2851
|
+
* This method does not write any changes to disk or update HEAD.
|
|
2852
|
+
* it is useful for computing what the cherrypick result would look like without actually applying it.
|
|
2853
|
+
*
|
|
2854
|
+
* @category Repository/Methods
|
|
2855
|
+
* @signature
|
|
2856
|
+
* ```ts
|
|
2857
|
+
* class Repository {
|
|
2858
|
+
* cherrypickCommit(
|
|
2859
|
+
* cherrypickCommit: Commit,
|
|
2860
|
+
* ourCommit: Commit,
|
|
2861
|
+
* mainline: number,
|
|
2862
|
+
* mergeOptions?: MergeOptions | undefined | null,
|
|
2863
|
+
* ): Index;
|
|
2864
|
+
* }
|
|
2865
|
+
* ```
|
|
2866
|
+
*
|
|
2867
|
+
* @param {Commit} cherrypickCommit - The commit to cherrypick.
|
|
2868
|
+
* @param {Commit} ourCommit - The commit to cherrypick against (usually HEAD).
|
|
2869
|
+
* @param {number} mainline - The parent of the cherrypick commit, if it is a merge (1-based).
|
|
2870
|
+
* @param {MergeOptions} [mergeOptions] - Options for merge conflict resolution.
|
|
2871
|
+
* @returns The index result.
|
|
2872
|
+
* @throws {Error} If the cherrypick commit is a merge and mainline is 0.
|
|
2873
|
+
* @throws {Error} If there are conflicts and failOnConflict is true (default).
|
|
2874
|
+
*
|
|
2875
|
+
* @example
|
|
2876
|
+
* ```ts
|
|
2877
|
+
* // This is an example for cherrypick_commit
|
|
2878
|
+
* import { openRepository } from "es-git";
|
|
2879
|
+
*
|
|
2880
|
+
* const repo = await openRepository("./path/to/repo");
|
|
2881
|
+
* const cherry = repo.getCommit("cherrypick-commit");
|
|
2882
|
+
* const target = repo.getCommit("onto-commit");
|
|
2883
|
+
*
|
|
2884
|
+
* // Returns the Index resulting from the cherrypick in memory,
|
|
2885
|
+
* // without affecting HEAD or the working tree.
|
|
2886
|
+
* // The mainline parameter indicates which parent to use as the baseline,
|
|
2887
|
+
* // For merge commits, mainline specifies which parent to use as baseline (1 or 2).
|
|
2888
|
+
* // For normal (non-merge) commits, use mainline 0.
|
|
2889
|
+
* const idx = repo.cherrypickCommit(cherry, target, 0);
|
|
2890
|
+
*
|
|
2891
|
+
* // You can check for conflicts with idx.hasConflicts()
|
|
2892
|
+
* ```
|
|
2893
|
+
*/
|
|
2894
|
+
cherrypickCommit(cherrypickCommit: Commit, ourCommit: Commit, mainline: number, mergeOptions?: MergeOptions | undefined | null): Index
|
|
2803
2895
|
/**
|
|
2804
2896
|
* Lookup a reference to one of the commits in a repository.
|
|
2805
2897
|
*
|
|
@@ -2872,6 +2964,25 @@ export declare class Repository {
|
|
|
2872
2964
|
* (if they are available).
|
|
2873
2965
|
*/
|
|
2874
2966
|
config(): Config
|
|
2967
|
+
/**
|
|
2968
|
+
* Describes a commit
|
|
2969
|
+
*
|
|
2970
|
+
* Performs a describe operation on the current commit and the worktree.
|
|
2971
|
+
* After performing a describe on `HEAD`, a status is run and description is
|
|
2972
|
+
* considered to be dirty if there are.
|
|
2973
|
+
*
|
|
2974
|
+
* @category Repository/Methods
|
|
2975
|
+
* @signature
|
|
2976
|
+
* ```ts
|
|
2977
|
+
* class Repository {
|
|
2978
|
+
* describe(options?: DescribeOptions | null | undefined): Describe;
|
|
2979
|
+
* }
|
|
2980
|
+
* ```
|
|
2981
|
+
*
|
|
2982
|
+
* @param {DescribeOptions} [options] - Options for describe operation.
|
|
2983
|
+
* @returns Instance of describe.
|
|
2984
|
+
*/
|
|
2985
|
+
describe(options?: DescribeOptions | undefined | null): Describe
|
|
2875
2986
|
/**
|
|
2876
2987
|
* Create a diff with the difference between two tree objects.
|
|
2877
2988
|
*
|
|
@@ -4584,25 +4695,6 @@ export declare class Repository {
|
|
|
4584
4695
|
* @returns If it does not exist, returns `null`.
|
|
4585
4696
|
*/
|
|
4586
4697
|
findTree(oid: string): Tree | null
|
|
4587
|
-
/**
|
|
4588
|
-
* Describes a commit
|
|
4589
|
-
*
|
|
4590
|
-
* Performs a describe operation on the current commit and the worktree.
|
|
4591
|
-
* After performing a describe on `HEAD`, a status is run and description is
|
|
4592
|
-
* considered to be dirty if there are.
|
|
4593
|
-
*
|
|
4594
|
-
* @category Repository/Methods
|
|
4595
|
-
* @signature
|
|
4596
|
-
* ```ts
|
|
4597
|
-
* class Repository {
|
|
4598
|
-
* describe(options?: DescribeOptions | null | undefined): Describe;
|
|
4599
|
-
* }
|
|
4600
|
-
* ```
|
|
4601
|
-
*
|
|
4602
|
-
* @param {DescribeOptions} [options] - Options for describe operation.
|
|
4603
|
-
* @returns Instance of describe.
|
|
4604
|
-
*/
|
|
4605
|
-
describe(options?: DescribeOptions | undefined | null): Describe
|
|
4606
4698
|
}
|
|
4607
4699
|
|
|
4608
4700
|
/**
|
|
@@ -5828,6 +5920,21 @@ export interface CheckoutOptions {
|
|
|
5828
5920
|
theirLabel?: string
|
|
5829
5921
|
}
|
|
5830
5922
|
|
|
5923
|
+
/** Options for cherrypick behavior. */
|
|
5924
|
+
export interface CherrypickOptions {
|
|
5925
|
+
/**
|
|
5926
|
+
* Parent number for merge commits (1-based).
|
|
5927
|
+
*
|
|
5928
|
+
* When cherrypicking a merge commit, the mainline parent is the one you want to
|
|
5929
|
+
* cherrypick from. The mainline is the branch from which the merge was made.
|
|
5930
|
+
*/
|
|
5931
|
+
mainline?: number
|
|
5932
|
+
/** Options for merge resolution when cherrypicking a merge commit. */
|
|
5933
|
+
mergeOptions?: MergeOptions
|
|
5934
|
+
/** Options for checkout behavior when updating working directory. */
|
|
5935
|
+
checkoutOptions?: CheckoutOptions
|
|
5936
|
+
}
|
|
5937
|
+
|
|
5831
5938
|
/**
|
|
5832
5939
|
* Clone a remote repository.
|
|
5833
5940
|
*
|
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.166+44a2a2d",
|
|
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.166+44a2a2d",
|
|
58
|
+
"es-git-darwin-arm64": "0.5.0-next.166+44a2a2d",
|
|
59
|
+
"es-git-win32-x64-msvc": "0.5.0-next.166+44a2a2d",
|
|
60
|
+
"es-git-win32-arm64-msvc": "0.5.0-next.166+44a2a2d",
|
|
61
|
+
"es-git-linux-x64-gnu": "0.5.0-next.166+44a2a2d",
|
|
62
|
+
"es-git-linux-x64-musl": "0.5.0-next.166+44a2a2d",
|
|
63
|
+
"es-git-android-arm64": "0.5.0-next.166+44a2a2d",
|
|
64
|
+
"es-git-linux-arm64-gnu": "0.5.0-next.166+44a2a2d",
|
|
65
|
+
"es-git-linux-arm64-musl": "0.5.0-next.166+44a2a2d",
|
|
66
|
+
"es-git-android-arm-eabi": "0.5.0-next.166+44a2a2d"
|
|
67
67
|
}
|
|
68
68
|
}
|