(file_path)
| 43 | |
| 44 | # 比较提交记录 |
| 45 | def is_file_changed_in_last_commit(file_path): |
| 46 | try: |
| 47 | result = subprocess.run( |
| 48 | ['git', 'diff', '--name-only', 'HEAD^', 'HEAD'], |
| 49 | capture_output=True, |
| 50 | text=True, |
| 51 | check=True |
| 52 | ) |
| 53 | changed_files = result.stdout.splitlines() |
| 54 | return file_path in changed_files |
| 55 | except subprocess.CalledProcessError as e: |
| 56 | print(f"Error occurred while running git command: {e}") |
| 57 | return False |
| 58 | |
| 59 | |
| 60 | def is_file_modified(file_path): |
no outgoing calls
no test coverage detected