Push the notes to the remote repository.
(
config: EvoGitConfig, async_push: bool = True
)
| 775 | |
| 776 | |
| 777 | def push_notes_to_remote( |
| 778 | config: EvoGitConfig, async_push: bool = True |
| 779 | ) -> subprocess.Popen | None: |
| 780 | """Push the notes to the remote repository.""" |
| 781 | remote_notes_namespace = f"refs/notes/{config.hostname}-commits" |
| 782 | cmd = [ |
| 783 | "git", |
| 784 | "push", |
| 785 | "-q", |
| 786 | "origin", |
| 787 | f"refs/notes/commits:{remote_notes_namespace}", |
| 788 | ] |
| 789 | if async_push: |
| 790 | # spawn the push process and return immediately |
| 791 | # don't wait for the push to finish |
| 792 | return subprocess.Popen( |
| 793 | cmd, |
| 794 | cwd=config.git_dir, |
| 795 | stdout=subprocess.DEVNULL, |
| 796 | stderr=subprocess.DEVNULL, |
| 797 | ) |
| 798 | else: |
| 799 | subprocess.run( |
| 800 | cmd, |
| 801 | cwd=config.git_dir, |
| 802 | check=True, |
| 803 | stdout=subprocess.DEVNULL, |
| 804 | stderr=subprocess.DEVNULL, |
| 805 | ) |
| 806 | |
| 807 | |
| 808 | def fetch_from_remote( |
nothing calls this directly
no outgoing calls
no test coverage detected