def test_add_file3_to_worktree_and_index_and_delete_in_worktree
    in_temp_dir do |worktree_path|

      # Given

      setup_worktree(worktree_path)
      File.open('file3', 'w', 0o644) { |f| f.write('content3') }
      `git add file3`
      File.delete('file3')
      git = Git.open(worktree_path)

      log_git_status
      # Output of `git status --porcelain=v2 --untracked-files=all --branch`:
      #
      # # branch.oid 9a6c20a5ca26595796ff5c2ef6e6a806ae4427f3
      # # branch.head main
      # 1 AD N... 000000 100644 000000 0000000000000000000000000000000000000000 a2b32293aab475bf50798c7642f0fe0593c167f6 file3

      # When

      status = git.status

      # Then

      expected_status_files = [
        {
          path: 'file1', type: nil, stage: '0', untracked: nil,
          mode_index: expect_read_write_mode, sha_index: '146edcbe0a35a475bd97aa6fbf83ecf8b21cfeec',
          mode_repo: nil, sha_repo: nil
        },
        {
          path: 'file2', type: nil, stage: '0', untracked: nil,
          mode_index: expect_execute_mode, sha_index: 'c061beb85924d309fde78d996a7602544e4f69a5',
          mode_repo: nil, sha_repo: nil
        },
        {
          path: 'file3', type: 'D', stage: '0', untracked: nil,
          mode_index: '000000', sha_index: '0000000000000000000000000000000000000000',
          mode_repo: expect_read_write_mode, sha_repo: 'a2b32293aab475bf50798c7642f0fe0593c167f6'
        }
      ]

      assert_has_status_files(expected_status_files, status.files)
    end
  end
* Add { path: 'file3', content: 'content3', mode: expect_read_write_mode } to the worktree, add
file3 to the index, delete file3 in the worktree [DONE]