From 7fb1bc87a9ce5e74d87d475b366305d7eb914d90 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Wed, 10 Jun 2020 10:11:34 +0000 Subject: [PATCH] Fix file wrong file permissions in Git hook. --- src/flake8/main/git.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/flake8/main/git.py b/src/flake8/main/git.py index 683396a..6200197 100644 --- a/src/flake8/main/git.py +++ b/src/flake8/main/git.py @@ -152,6 +152,7 @@ def copy_file_to(destination_directory, filepath, contents): temporary_filepath = os.path.join(temporary_directory, filename) with open(temporary_filepath, "wb") as fd: fd.write(contents) + shutil.copystat(filepath, temporary_filepath) return temporary_filepath