Merge branch 'rk/commit-tree-make-F-verbatim'
authorJunio C Hamano <gitster@pobox.com>
Tue, 19 Sep 2017 01:47:57 +0000 (10:47 +0900)
committerJunio C Hamano <gitster@pobox.com>
Tue, 19 Sep 2017 01:47:57 +0000 (10:47 +0900)
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

1  2 
builtin/commit-tree.c
diff --combined builtin/commit-tree.c
index 19e898fa4e46da9271de950ad9add75af2051ed6,c1de41c67f8c245ab53b3c3c86a9ad981f433917..2177251e247cc144d6ac8619fa5940262430d50a
@@@ -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);
                        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");