From 37106ba02a699eb485edcc2e5058dcaf25ee92a0 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Mon, 10 Jul 2023 17:47:25 +0100 Subject: utils: checkstyle.py: Initialise staged trailers There are no possible Trailers for staged changes as the commit message has not yet been written. Initialise the empty trailers when the commit object is initialised. Reviewed-by: Umang Jain Tested-by: Jacopo Mondi Signed-off-by: Kieran Bingham --- utils/checkstyle.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'utils/checkstyle.py') diff --git a/utils/checkstyle.py b/utils/checkstyle.py index 5a126806..2ba3165b 100755 --- a/utils/checkstyle.py +++ b/utils/checkstyle.py @@ -253,6 +253,9 @@ class StagedChanges(Commit): def __init__(self): Commit.__init__(self, '') + # There are no trailers to parse on a Staged Change. + self._trailers = [] + def _parse(self): ret = subprocess.run(['git', 'diff', '--staged', '--name-status'], stdout=subprocess.PIPE).stdout.decode('utf-8') -- cgit v1.2.1