commit_file: fix diff computation

previously computed diff over all files
This commit is contained in:
DavHau 2023-11-13 19:59:20 +07:00
parent 42dba72239
commit 14c4b99891

View File

@ -53,7 +53,7 @@ def _commit_file_to_git(repo_dir: Path, file_path: Path, commit_message: str) ->
# check if there is a diff
cmd = nix_shell(
["git"],
["git", "-C", str(repo_dir), "diff", "--cached", "--exit-code"],
["git", "-C", str(repo_dir), "diff", "--cached", "--exit-code", str(file_path)],
)
result = subprocess.run(cmd, cwd=repo_dir)
# if there is no diff, return