Loading hooks/copyright.py +6 −2 Original line number Diff line number Diff line Loading @@ -67,6 +67,9 @@ def get_file_years(paths: list[Path], ignored_commits: set[str]) -> dict[Path, i cmd.extend(p.as_posix() for p in paths) proc = run(cmd, stdout=PIPE, check=True) if not proc.stdout: return output for result in proc.stdout.split(b'\0\0'): commits, files = result.splitlines() combos = product(split_commits(commits), split_paths(files)) Loading Loading @@ -166,12 +169,13 @@ def main() -> None: grafts = get_grafted() years = get_file_years(paths, grafts) years.update((path, year) for path in get_changed(paths)) years.update((path, year) for path in paths if path not in years and path.is_file()) else: years = {path: year for path in paths if path.is_file()} missing = [] for path in paths: if path.is_file() and path in years and not check_file(path, years[path], opts.min_size): for path, year in years.items(): if not check_file(path, year, opts.min_size): missing.append(path) if missing: Loading Loading
hooks/copyright.py +6 −2 Original line number Diff line number Diff line Loading @@ -67,6 +67,9 @@ def get_file_years(paths: list[Path], ignored_commits: set[str]) -> dict[Path, i cmd.extend(p.as_posix() for p in paths) proc = run(cmd, stdout=PIPE, check=True) if not proc.stdout: return output for result in proc.stdout.split(b'\0\0'): commits, files = result.splitlines() combos = product(split_commits(commits), split_paths(files)) Loading Loading @@ -166,12 +169,13 @@ def main() -> None: grafts = get_grafted() years = get_file_years(paths, grafts) years.update((path, year) for path in get_changed(paths)) years.update((path, year) for path in paths if path not in years and path.is_file()) else: years = {path: year for path in paths if path.is_file()} missing = [] for path in paths: if path.is_file() and path in years and not check_file(path, years[path], opts.min_size): for path, year in years.items(): if not check_file(path, year, opts.min_size): missing.append(path) if missing: Loading