class Git::Commands::ReadTree

Implements the ‘git read-tree` command

Reads tree information into the index. Optionally performs a merge (single-tree, two-way fast-forward, or three-way) with the ‘-m` flag, and updates the working tree files with `-u`.

@example Read a single tree into the index

read_tree = Git::Commands::ReadTree.new(execution_context)
result = read_tree.call('HEAD')

@example Read a tree under a prefix directory

read_tree = Git::Commands::ReadTree.new(execution_context)
result = read_tree.call('HEAD', prefix: 'subdir/')

@example Perform a three-way merge

read_tree = Git::Commands::ReadTree.new(execution_context)
result = read_tree.call('base', 'ours', 'theirs', m: true, u: true)

@example Empty the index

read_tree = Git::Commands::ReadTree.new(execution_context)
result = read_tree.call(empty: true)

@note ‘arguments` block audited against git-scm.com/docs/git-read-tree/2.53.0

@see git-scm.com/docs/git-read-tree git-read-tree

@see Git::Commands

@api private