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 3745709449
commit 52af144135

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 # check if there is a diff
cmd = nix_shell( cmd = nix_shell(
["git"], ["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) result = subprocess.run(cmd, cwd=repo_dir)
# if there is no diff, return # if there is no diff, return