From b5a8a6a10401b63248e833ca02122e91c09b6bed Mon Sep 17 00:00:00 2001 From: Louis Bompart Date: Mon, 6 Nov 2023 00:21:35 -0500 Subject: [PATCH] feat: git reset (#198) --- src/git/doGitReset.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/git/doGitReset.ts diff --git a/src/git/doGitReset.ts b/src/git/doGitReset.ts new file mode 100644 index 00000000..50dab529 --- /dev/null +++ b/src/git/doGitReset.ts @@ -0,0 +1,12 @@ +import spawn from "../utils/spawn.js"; +import gitLogger from "./utils/gitLogger.js"; + +export default async function ({ + resetMode, + ref, +}: { + resetMode: "hard" | "soft" | "mixed"; + ref: string; +}) { + await spawn("git", ["reset", `--${resetMode}`, ref], gitLogger); +}