code: def local_git_repo(tmp_path):
      local_git = str(tmp_path.joinpath("git_repo"))
      repo = git.Repo.init(local_git)
      shutil.copytree(
          src=TEST_PROJECT_DIR, dst=local_git, dirs_exist_ok=True
      )
      shutil.copytree(
          src=os.path.dirname(TEST_PROJECT_DIR),
          dst=local_git,
          dirs_exist_ok=True,
      )
      repo.git.add(A=True)
      repo.index.commit("test")
      repo.create_head(GIT_PROJECT_BRANCH)
      return os.path.abspath(local_git)
  
imports: import os
  import shutil
  import git
  import pytest
  from tests.projects.utils import GIT_PROJECT_BRANCH, TEST_PROJECT_DIR
label_desc: Use image node_id 1 for calling a global function with example usage: local_git_repo(tmp_path) and returns: os