fix: error caused by non UTF-8 characters in git diff
This commit is contained in:
parent
a1d25d1fef
commit
d8903932c8
|
@ -29,3 +29,4 @@ Please keep the lists sorted alphabetically.
|
||||||
* Matthijs van der Boon
|
* Matthijs van der Boon
|
||||||
* Mayank Mittal
|
* Mayank Mittal
|
||||||
* Zhang Chong
|
* Zhang Chong
|
||||||
|
* Ziqi Fan
|
||||||
|
|
|
@ -78,7 +78,7 @@ def store_code_state(logdir, repositories) -> list:
|
||||||
continue
|
continue
|
||||||
# write the diff file
|
# write the diff file
|
||||||
print(f"Storing git diff for '{repo_name}' in: {diff_file_name}")
|
print(f"Storing git diff for '{repo_name}' in: {diff_file_name}")
|
||||||
with open(diff_file_name, "x") as f:
|
with open(diff_file_name, "x", encoding="utf-8") as f:
|
||||||
content = f"--- git status ---\n{repo.git.status()} \n\n\n--- git diff ---\n{repo.git.diff(t)}"
|
content = f"--- git status ---\n{repo.git.status()} \n\n\n--- git diff ---\n{repo.git.diff(t)}"
|
||||||
f.write(content)
|
f.write(content)
|
||||||
# add the file path to the list of files to be uploaded
|
# add the file path to the list of files to be uploaded
|
||||||
|
|
Loading…
Reference in New Issue