gitlab: add missing f.truncate() call to update.py script
when updating data.json, truncate file after reading and before writing again, or we otherwise might end up with broken json
This commit is contained in:
@@ -115,6 +115,7 @@ def _update_data_json(filename: str, repo: GitLabRepo, rev: str, flavour: str):
|
||||
data = json.load(f)
|
||||
data[flavour] = flavour_data
|
||||
f.seek(0)
|
||||
f.truncate()
|
||||
json.dump(data, f, indent=2)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user