(path: str)
| 372 | |
| 373 | |
| 374 | def git_last_commit_timestamp(path: str) -> int: |
| 375 | try: |
| 376 | relative_path = os.path.relpath(path, REPO_ROOT) |
| 377 | result = subprocess.run( |
| 378 | ["git", "-C", str(REPO_ROOT), "log", "-1", "--format=%ct", "--", relative_path], |
| 379 | capture_output=True, |
| 380 | text=True, |
| 381 | check=False, |
| 382 | ) |
| 383 | if result.returncode != 0: |
| 384 | return 0 |
| 385 | output = result.stdout.strip() |
| 386 | if not output: |
| 387 | return 0 |
| 388 | return int(output) |
| 389 | except Exception: |
| 390 | return 0 |
| 391 | |
| 392 | |
| 393 | def should_translate_based_on_translation(file_path: str) -> bool: |
no test coverage detected