mirror of
https://github.com/rclone/rclone.git
synced 2025-06-20 19:57:51 +02:00
build: fix check_autogenerated_edits.py flagging up files that didn't exist
Before this change new backend docs would have their changes flagged which is undesirable for the first revision.
This commit is contained in:
parent
210acb42cd
commit
51fd697c7a
@ -78,6 +78,10 @@ def check_file(file):
|
|||||||
new_lines = get_file_content("HEAD", file)
|
new_lines = get_file_content("HEAD", file)
|
||||||
old_lines = get_file_content("HEAD~1", file)
|
old_lines = get_file_content("HEAD~1", file)
|
||||||
|
|
||||||
|
# If old file did not exist or was empty then don't check
|
||||||
|
if not old_lines:
|
||||||
|
return
|
||||||
|
|
||||||
# Entire autogenerated file check.
|
# Entire autogenerated file check.
|
||||||
if any("autogenerated - DO NOT EDIT" in l for l in new_lines[:10]):
|
if any("autogenerated - DO NOT EDIT" in l for l in new_lines[:10]):
|
||||||
if get_diff(file):
|
if get_diff(file):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user