isomorphic-git 1.22.0 → 1.24.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.
package/index.d.ts CHANGED
@@ -648,6 +648,7 @@ declare namespace index {
648
648
  export { TREE };
649
649
  export { WORKDIR };
650
650
  export { add };
651
+ export { abortMerge };
651
652
  export { addNote };
652
653
  export { addRemote };
653
654
  export { annotatedTag };
@@ -743,6 +744,7 @@ export var Errors: Readonly<{
743
744
  UrlParseError: typeof UrlParseError;
744
745
  UserCanceledError: typeof UserCanceledError;
745
746
  UnmergedPathsError: typeof UnmergedPathsError;
747
+ IndexResetError: typeof IndexResetError;
746
748
  }>;
747
749
  /**
748
750
  * @returns {Walker}
@@ -760,6 +762,37 @@ export function TREE({ ref }?: {
760
762
  * @returns {Walker}
761
763
  */
762
764
  export function WORKDIR(): Walker;
765
+ /**
766
+ * Abort a merge in progress.
767
+ *
768
+ * Based on the behavior of git reset --merge, i.e. "Resets the index and updates the files in the working tree that are different between <commit> and HEAD, but keeps those which are different between the index and working tree (i.e. which have changes which have not been added). If a file that is different between <commit> and the index has unstaged changes, reset is aborted."
769
+ *
770
+ * Essentially, abortMerge will reset any files affected by merge conflicts to their last known good version at HEAD.
771
+ * Any unstaged changes are saved and any staged changes are reset as well.
772
+ *
773
+ * NOTE: The behavior of this command differs slightly from canonical git in that an error will be thrown if a file exists in the index and nowhere else.
774
+ * Canonical git will reset the file and continue aborting the merge in this case.
775
+ *
776
+ * **WARNING:** Running git merge with non-trivial uncommitted changes is discouraged: while possible, it may leave you in a state that is hard to back out of in the case of a conflict.
777
+ * If there were uncommitted changes when the merge started (and especially if those changes were further modified after the merge was started), `git.abortMerge` will in some cases be unable to reconstruct the original (pre-merge) changes.
778
+ *
779
+ * @param {object} args
780
+ * @param {FsClient} args.fs - a file system implementation
781
+ * @param {string} args.dir - The [working tree](dir-vs-gitdir.md) directory path
782
+ * @param {string} [args.gitdir=join(dir, '.git')] - [required] The [git directory](dir-vs-gitdir.md) path
783
+ * @param {string} [args.commit='HEAD'] - commit to reset the index and worktree to, defaults to HEAD
784
+ * @param {object} [args.cache] - a [cache](cache.md) object
785
+ *
786
+ * @returns {Promise<void>} Resolves successfully once the git index has been updated
787
+ *
788
+ */
789
+ export function abortMerge({ fs: _fs, dir, gitdir, commit, cache, }: {
790
+ fs: CallbackFsClient | PromiseFsClient;
791
+ dir: string;
792
+ gitdir?: string;
793
+ commit?: string;
794
+ cache?: any;
795
+ }): Promise<void>;
763
796
  /**
764
797
  * Add a file to the git index (aka staging area)
765
798
  *
@@ -770,6 +803,7 @@ export function WORKDIR(): Walker;
770
803
  * @param {string|string[]} args.filepath - The path to the file to add to the index
771
804
  * @param {object} [args.cache] - a [cache](cache.md) object
772
805
  * @param {boolean} [args.force=false] - add to index even if matches gitignore. Think `git add --force`
806
+ * @param {boolean} [args.parallel=false] - process each input file in parallel. Parallel processing will result in more memory consumption but less process time
773
807
  *
774
808
  * @returns {Promise<void>} Resolves successfully once the git index has been updated
775
809
  *
@@ -779,13 +813,14 @@ export function WORKDIR(): Walker;
779
813
  * console.log('done')
780
814
  *
781
815
  */
782
- export function add({ fs: _fs, dir, gitdir, filepath, cache, force, }: {
816
+ export function add({ fs: _fs, dir, gitdir, filepath, cache, force, parallel, }: {
783
817
  fs: CallbackFsClient | PromiseFsClient;
784
818
  dir: string;
785
819
  gitdir?: string;
786
820
  filepath: string | string[];
787
821
  cache?: any;
788
822
  force?: boolean;
823
+ parallel?: boolean;
789
824
  }): Promise<void>;
790
825
  /**
791
826
  * Add or update an object note
@@ -4192,6 +4227,21 @@ declare namespace UnmergedPathsError {
4192
4227
  const code_29: 'UnmergedPathsError';
4193
4228
  export { code_29 as code };
4194
4229
  }
4230
+ declare class IndexResetError extends BaseError {
4231
+ /**
4232
+ * @param {Array<string>} filepaths
4233
+ */
4234
+ constructor(filepath: any);
4235
+ code: "IndexResetError";
4236
+ name: "IndexResetError";
4237
+ data: {
4238
+ filepath: any;
4239
+ };
4240
+ }
4241
+ declare namespace IndexResetError {
4242
+ const code_30: 'IndexResetError';
4243
+ export { code_30 as code };
4244
+ }
4195
4245
  /**
4196
4246
  * @typedef {Object} GitProgressEvent
4197
4247
  * @property {string} phase