This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { RepoPath, CommitObject, GitError, MergeOptions, MergeReport } from 'isomorphic-git'; | |
import { getCommit, listCommits, merge } from 'isomorphic-git'; | |
// The cherryPick function takes a repository path and a commit SHA as input, and applies the | |
// changes made in the specified commit to the current branch. The function first gets the commit | |
// object for the specified commit, and then finds the parent commit(s) to use as the merge base(s). | |
// It then sets up the merge options, with ours set to the current HEAD commit and theirs set to the | |
// specified commit. The fastForwardOnly and noUpdateBranch options are used to ensure that the | |
// merge only applies changes from the specified commit, and does not change the branch reference | |
// or allow non-fast-forward merges. The merge function is then called to perform the merge and |