Skip to content

Commit

Permalink
Load original_content from disk if needed to calculate updated
Browse files Browse the repository at this point in the history
  • Loading branch information
cognifloyd authored Feb 15, 2022
1 parent d87a6d3 commit 9482195
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ansiblelint/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ def content(self, value: str) -> None:
if self._original_content is None:
if self._content is not None:
self._original_content = self._content
elif not self.path.exists():
elif self.path.exists():
# use self.content to populate self._original_content
_ = self.content
else:
# new file
self._original_content = ""
self.updated = self._original_content != value
Expand Down

0 comments on commit 9482195

Please sign in to comment.