From: Oleg Broytman Date: Sun, 2 Feb 2020 15:43:33 +0000 (+0300) Subject: Fix(set-commit-date.py): Skip symlinks X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=commitdiff_plain;h=467b1c39d782a3f2d0b31d73033a0af952896295 Fix(set-commit-date.py): Skip symlinks An earlier symlink to a file should not override the later file. --- diff --git a/set-commit-date.py b/set-commit-date.py index 74972e4..c0aaa8c 100755 --- a/set-commit-date.py +++ b/set-commit-date.py @@ -66,7 +66,7 @@ for line in git_log.stdout: deleted_files.add(filename) if filename not in deleted_files and filename not in changed_files: changed_files.add(filename) - if os.path.exists(filename): + if os.path.exists(filename) and not os.path.islink(filename): os.utime(filename, (time, time)) else: raise ValueError("stage: %d, line: %s" % (stage, line))