Follow renames when looking for the creation of a file

Signed-off-by: Gilles Peskine <[email protected]>
This commit is contained in:
Gilles Peskine
2020-03-26 22:50:11 +01:00
parent 13dc634282
commit 98a53aa399
+3 -1
View File
@@ -260,7 +260,9 @@ class EntryFileSortKey:
Return None if the file was never checked into git.
"""
hashes = subprocess.check_output(['git', 'log', '--format=%H', '--', filename])
hashes = subprocess.check_output(['git', 'log', '--format=%H',
'--follow',
'--', filename])
m = re.search(b'(.+)$', hashes)
if not m:
# The git output is empty. This means that the file was