class Git::Commands::CommitTree
Implements the ‘git commit-tree` command
Creates a new commit object based on the provided tree object and emits the new commit object id on stdout. The log message is provided via ‘-m` or `-F` options; multiple instances of either are concatenated as separate paragraphs.
@example Typical usage
commit_tree = Git::Commands::CommitTree.new(execution_context) commit_tree.call('abc123', m: 'Initial commit') commit_tree.call('abc123', p: %w[parent1 parent2], m: 'Merge') commit_tree.call('abc123', m: 'Signed', gpg_sign: true)
@note ‘arguments` block audited against git-scm.com/docs/git-commit-tree/2.53.0
@see Git::Commands
@see git-scm.com/docs/git-commit-tree git-commit-tree
@api private
Public Instance Methods
Source
# File lib/git/commands/commit_tree.rb, line 96 def call(*, **) super end
@overload call(tree, **options)
Execute the `git commit-tree` command @param tree [String] an existing tree object SHA @param options [Hash] command options @option options [String, Array<String>] :p (nil) parent commit object id(s) Each value adds a `-p <parent>` flag. A commit may have zero or more parents. With exactly one parent it is an ordinary commit; with more than one it is a merge commit. Initial (root) commits have no parents. @option options [Boolean, String, nil] :gpg_sign (nil) sign the commit with GPG (`--gpg-sign`) Pass a key-ID string to select the signing key; pass `true` to use the committer identity. Alias: `:S` @option options [Boolean, nil] :no_gpg_sign (nil) countermand commit.gpgSign configuration (`--no-gpg-sign`) @option options [String, Array<String>] :m (nil) a paragraph in the commit log message Can be given more than once; each message becomes its own paragraph. @option options [String, Array<String>] :F (nil) read the commit log message from the given file Use `"-"` to read from standard input. Can be given more than once; each file's content becomes its own paragraph. @return [Git::CommandLine::Result] the result of calling `git commit-tree` @raise [ArgumentError] if unsupported options are provided @raise [ArgumentError] if the tree operand is missing @raise [Git::FailedError] if git exits with a non-zero exit status @api public
Calls superclass method
Git::Commands::Base::call