Verified Commit 54f0b071 authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Early exit from copyright.py func with *static* value

parent 3f34e9d3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -57,8 +57,6 @@ def get_file_years(paths: list[Path], ignored_commits: set[str]) -> dict[Path, i
	"""
	Return a mapping of paths to the year they where last changed (if they are tracked)
	"""
	output = dict[Path, int]()

	cmd = [
		'git', 'log', '--topo-order',
		'--format=format:%ad %H', '--date=format:%Y',
@@ -68,7 +66,9 @@ def get_file_years(paths: list[Path], ignored_commits: set[str]) -> dict[Path, i
	proc = run(cmd, stdout=PIPE, check=True)

	if not proc.stdout:
		return output
		return {}

	output = dict[Path, int]()

	for result in proc.stdout.split(b'\0\0'):
		commits, files = result.splitlines()