diff --git a/src/git/doGitDiff.ts b/src/git/doGitDiff.ts index 8281a24f..ac039cd8 100644 --- a/src/git/doGitDiff.ts +++ b/src/git/doGitDiff.ts @@ -1,9 +1,13 @@ import spawn from "../utils/spawn.js"; import gitLogger from "./utils/gitLogger.js"; -export default async function gitDiff() { +export default async function gitDiff(args: string[] = []): Promise { return ( - await spawn("git", ["--no-pager", "diff", "--name-only"], gitLogger) + await spawn( + "git", + ["--no-pager", "diff", "--name-only", ...args], + gitLogger, + ) ).stdout .trim() .split("\n"); diff --git a/src/git/getSHA1FromRef.ts b/src/git/getSHA1FromRef.ts index f92ffcf5..36e05c96 100644 --- a/src/git/getSHA1FromRef.ts +++ b/src/git/getSHA1FromRef.ts @@ -1,6 +1,11 @@ import spawn from "../utils/spawn.js"; import gitLogger from "./utils/gitLogger.js"; -export default async function (ref: string) { - return (await spawn("git", ["rev-parse", ref], gitLogger)).stdout.trim(); +export default async function ( + ref: string, + args: string[] = [], +): Promise { + return ( + await spawn("git", ["rev-parse", ...args, ref], gitLogger) + ).stdout.trim(); }