Skip to content

Commit 0f48cc6

Browse files
authored
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.
1 parent 2acf833 commit 0f48cc6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/utils/git.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const getStagedFiles = async (): Promise<string[]> => {
3030
'diff',
3131
'--name-only',
3232
'--cached',
33+
'--relative'
3334
]);
3435

3536
const filesList = files.split('\n');

0 commit comments

Comments
 (0)