From 0f48cc616e40d4eb60636e4602d70387e7789966 Mon Sep 17 00:00:00 2001 From: Moret84 Date: Tue, 21 Mar 2023 08:08:46 +0100 Subject: [PATCH] fix(git.ts): add relative flag to git diff command (#37) The relative flag has been added to the git diff command in the getStagedFiles function. This flag makes the output of the command relative to the current working directory, which makes it easier to work with the file paths and enables executing opencommit from anywhere in the repository, not just from the root. --- src/utils/git.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/git.ts b/src/utils/git.ts index e492473..d971eb6 100644 --- a/src/utils/git.ts +++ b/src/utils/git.ts @@ -30,6 +30,7 @@ export const getStagedFiles = async (): Promise => { 'diff', '--name-only', '--cached', + '--relative' ]); const filesList = files.split('\n');