code: def _interactive_git_proc(
      proc: git.Git.AutoInterrupt,
      collector: _DiffCollector,
      ignore_status: bool = False,
  ):
      while True:
          try:
              stdout, stderr = proc.communicate(
                  timeout=collector.timeout()
              )
              if not ignore_status and proc.poll() != 0:
                  raise git.GitCommandError(
                      proc.args, proc.poll(), stderr
                  )
              collector.write(stdout)
              return
          except subprocess.TimeoutExpired:
              continue
  
imports: import io
  import subprocess
  import time
  from typing import BinaryIO, Optional
  import git
  import giturlparse
  from pydantic import BaseModel, Field
  from typing_extensions import Literal
  from dstack._internal.core.errors import DstackError
  from dstack._internal.core.models.repos.base import BaseRepoInfo, Repo, RepoProtocol
  from dstack._internal.utils.hash import get_sha256, slugify
  from dstack._internal.utils.path import PathLike
  from dstack._internal.utils.ssh import get_host_config
label_desc: Use image node_id 1 for calling a global function with example usage: _interactive_git_proc(proc, collector, ignore_status) without return types