From 70eb4b4d13b4ee18659f5f01a44e7ea3970f39ed Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 04 2019 10:29:09 +0000 Subject: Always instantiate the status variable Otherwise if we end up with an unknown status, pagure blows up as the variable is undefined. Fixes https://pagure.io/pagure/issue/4311 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/git.py b/pagure/lib/git.py index 98592e7..9109539 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -2663,6 +2663,7 @@ def get_stats_patch(patch): output["new_id"] = str(patch.new_id) output["old_id"] = str(patch.old_id) elif hasattr(patch, "delta"): + status = None # Newer pygit2 # we recognize non-executable file, executable file and symlink expected_modes = [33188, 33261, 40960]