From: Junio C Hamano Date: Tue, 19 Sep 2017 01:47:57 +0000 (+0900) Subject: Merge branch 'rk/commit-tree-make-F-verbatim' X-Git-Tag: v2.15.0-rc0~77 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/4d46bce6b07b8047aad2726e5dc42edcc6787d6b?ds=inline;hp=-c Merge branch 'rk/commit-tree-make-F-verbatim' Unlike "git commit-tree < file", "git commit-tree -F file" did not pass the contents of the file verbatim and instead completed an incomplete line at the end, if exists. The latter has been updated to match the behaviour of the former. * rk/commit-tree-make-F-verbatim: commit-tree: do not complete line in -F input --- 4d46bce6b07b8047aad2726e5dc42edcc6787d6b diff --combined builtin/commit-tree.c index 19e898fa4e,c1de41c67f..2177251e24 --- a/builtin/commit-tree.c +++ b/builtin/commit-tree.c @@@ -56,7 -56,7 +56,7 @@@ int cmd_commit_tree(int argc, const cha struct object_id oid; if (argc <= ++i) usage(commit_tree_usage); - if (get_sha1_commit(argv[i], oid.hash)) + if (get_oid_commit(argv[i], &oid)) die("Not a valid object name %s", argv[i]); assert_sha1_type(oid.hash, OBJ_COMMIT); new_parent(lookup_commit(&oid), &parents); @@@ -102,11 -102,10 +102,10 @@@ if (fd && close(fd)) die_errno("git commit-tree: failed to close '%s'", argv[i]); - strbuf_complete_line(&buffer); continue; } - if (get_sha1_tree(arg, tree_oid.hash)) + if (get_oid_tree(arg, &tree_oid)) die("Not a valid object name %s", arg); if (got_tree) die("Cannot give more than one trees");