Merge branch 'js/filter-branch-prime'
[gitweb.git] / builtin-diff-tree.c
index 1138c2da733bfe2730bbcb95d2a281de12595bde..2380c21951fb5fb8050ab1acf0e7f01f36ea5520 100644 (file)
@@ -71,8 +71,9 @@ static int diff_tree_stdin(char *line)
        line[len-1] = 0;
        if (get_sha1_hex(line, sha1))
                return -1;
-       obj = lookup_object(sha1);
-       obj = obj ? obj : parse_object(sha1);
+       obj = lookup_unknown_object(sha1);
+       if (!obj || !obj->parsed)
+               obj = parse_object(sha1);
        if (!obj)
                return -1;
        if (obj->type == OBJ_COMMIT)
@@ -101,9 +102,9 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix)
 
        init_revisions(opt, prefix);
        git_config(git_diff_basic_config, NULL); /* no "diff" UI options */
-       nr_sha1 = 0;
        opt->abbrev = 0;
        opt->diff = 1;
+       opt->disable_stdin = 1;
        argc = setup_revisions(argc, argv, opt, NULL);
 
        while (--argc > 0) {