From bde64fb5da162538218b5f27fe8985b93fbca5f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Santos?= <4837+borfast@users.noreply.github.com> Date: Mon, 17 Mar 2025 22:56:45 +0000 Subject: [PATCH] Fix git add . on pre-commit hook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "git add ." adds *ALL* changes in the working directory into the commit, whether they had been staged or not. This means the commit would end up with files the user may not have intended to be there. Instead, only files that were already staged should be added, which the -u flag provides. Signed-off-by: Raúl Santos <4837+borfast@users.noreply.github.com> --- frontend/.husky/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/.husky/pre-commit b/frontend/.husky/pre-commit index 8f93f96a7..2551284d4 100644 --- a/frontend/.husky/pre-commit +++ b/frontend/.husky/pre-commit @@ -3,5 +3,5 @@ if git diff --name-only --cached | grep 'frontend/'; then echo "FRONTEND FOLDER CHANGED --> starting husky..." cd frontend && pnpm lint:fix && pnpm tsc-check - git add . + git add -u fi