Read the note of the specified commit. If commit is None, read the note of the current HEAD. Return None if the note does not exist.
(config: EvoGitConfig, commit: Optional[str])
| 312 | |
| 313 | |
| 314 | def read_note(config: EvoGitConfig, commit: Optional[str]) -> Optional[str]: |
| 315 | """Read the note of the specified commit. If commit is None, read the note of the current HEAD. |
| 316 | Return None if the note does not exist. |
| 317 | """ |
| 318 | |
| 319 | cmd = ["git", "notes", "show"] |
| 320 | if commit is not None: |
| 321 | cmd.append(commit) |
| 322 | |
| 323 | completed_proc = subprocess.run( |
| 324 | cmd, |
| 325 | cwd=config.git_dir, |
| 326 | capture_output=True, |
| 327 | ) |
| 328 | |
| 329 | if completed_proc.returncode != 0: |
| 330 | return None |
| 331 | else: |
| 332 | return completed_proc.stdout.decode("utf-8") |
| 333 | |
| 334 | |
| 335 | def update_file_in_worktree( |
nothing calls this directly
no outgoing calls
no test coverage detected