Re: [PATCH 5/5] Split out the actual commit creation from the option parsing etc.
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 31, 2007, 04:43 UTC
- Message-ID
- <7v8x8xgp3s.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <11858309332705-git-send-email-krh@redhat.com>
Kristian Høgsberg <krh@redhat.com> writes:
Show 17 quoted lines
> @@ -85,40 +129,20 @@ int cmd_commit_tree(int argc, const char **argv, const char *prefix)
> parents++;
> }
>
> - /* Not having i18n.commitencoding is the same as having utf-8 */
> - encoding_is_utf8 = is_encoding_utf8(git_commit_encoding);
> + buffer = NULL;
> + if (read_fd(0, &buffer, &len))
> + die("Could not read commit message from standard input");
>
> - strbuf_init(&sb);
> - strbuf_printf(&sb, "tree %s\n", sha1_to_hex(tree_sha1));
> + commit_sha1 = create_commit(tree_sha1,
> + parent_sha1, parents,
> + xstrdup(git_author_info(1)),
> + xstrdup(git_committer_info(1)),
> + buffer, len);Hmph, the series was so nice so far, but here we have a few new leak, presumably so small per process invocation that we do not care about?