From 76d2168b3247060b104ddf7da431405ac7933259 Mon Sep 17 00:00:00 2001 From: skjnldsv Date: Tue, 3 Sep 2024 21:23:58 +0200 Subject: [PATCH] fix: git clean syntax Signed-off-by: skjnldsv --- src/gitUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gitUtils.ts b/src/gitUtils.ts index d697ba4..9e470b3 100644 --- a/src/gitUtils.ts +++ b/src/gitUtils.ts @@ -1,6 +1,6 @@ import { existsSync, mkdirSync} from 'node:fs' import { join } from 'node:path' -import { simpleGit } from 'simple-git' +import { CleanOptions, simpleGit } from 'simple-git' import { CACHE_DIRNAME, CherryPickResult, ROOT_DIR, Task, WORK_DIRNAME } from './constants.js' import { debug, error } from './logUtils.js' @@ -39,7 +39,7 @@ export const cloneAndCacheRepo = async (task: Task, backportBranch: string): Pro await git.clone(`https://github.com/${owner}/${repo}`, '.') } else { // Is already a repository so make sure it is clean and follows the default branch - await git.clean(['-X', '-d', '-f']) + await git.clean(CleanOptions.FORCE + CleanOptions.IGNORED_ONLY + CleanOptions.RECURSIVE) debug(task, `Repo already cached at ${cachedRepoRoot}`) } } catch (e) {