def _setup_git_repos(self):
        """Set up real git repositories for testing."""
        # Set up origin repository
        self._execute_command(
            'git --no-pager init --initial-branch=main', self.origin_dir
        )
        self._execute_command(
            "git --no-pager config user.email 'test@example.com'", self.origin_dir
        )
        self._execute_command(
            "git --no-pager config user.name 'Test User'", self.origin_dir
        )

        # Create a file and commit it
        with open(os.path.join(self.origin_dir, 'file1.txt'), 'w') as f:
            f.write('Original content')

        self._execute_command('git --no-pager add file1.txt', self.origin_dir)
        self._execute_command(
            "git --no-pager commit -m 'Initial commit'", self.origin_dir
        )

        # Clone the origin repository to local
        self._execute_command(
            f'git --no-pager clone {self.origin_dir} {self.local_dir}'
        )
        self._execute_command(
            "git --no-pager config user.email 'test@example.com'", self.local_dir
        )
        self._execute_command(
            "git --no-pager config user.name 'Test User'", self.local_dir
        )

        # Create a feature branch in the local repository
        self._execute_command(
            'git --no-pager checkout -b feature-branch', self.local_dir
        )

        # Modify a file and create a new file
        with open(os.path.join(self.local_dir, 'file1.txt'), 'w') as f:
            f.write('Modified content')

        with open(os.path.join(self.local_dir, 'file2.txt'), 'w') as f:
            f.write('New file content')

        # Add and commit file1.txt changes to create a baseline
        self._execute_command('git --no-pager add file1.txt', self.local_dir)
        self._execute_command(
            "git --no-pager commit -m 'Update file1.txt'", self.local_dir
        )

        # Add and commit file2.txt, then modify it
        self._execute_command('git --no-pager add file2.txt', self.local_dir)
        self._execute_command(
            "git --no-pager commit -m 'Add file2.txt'", self.local_dir
        )

        # Modify file2.txt and stage it
        with open(os.path.join(self.local_dir, 'file2.txt'), 'w') as f:
            f.write('Modified new file content')
        self._execute_command('git --no-pager add file2.txt', self.local_dir)

        # Create a file that will be deleted
        with open(os.path.join(self.local_dir, 'file3.txt'), 'w') as f:
            f.write('File to be deleted')

        self._execute_command('git --no-pager add file3.txt', self.local_dir)
        self._execute_command(
            "git --no-pager commit -m 'Add file3.txt'", self.local_dir
        )
        self._execute_command('git --no-pager rm file3.txt', self.local_dir)

        # Modify file1.txt again but don't stage it (unstaged change)
        with open(os.path.join(self.local_dir, 'file1.txt'), 'w') as f:
            f.write('Modified content again')

        # Push the feature branch to origin
        self._execute_command(
            'git --no-pager push -u origin feature-branch', self.local_dir
        )
Set up real git repositories for testing.
tests/unit/test_git_handler.py