summaryrefslogtreecommitdiff
path: root/builtin-diff-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-09-10 12:22:35 -0700
committerJunio C Hamano <gitster@pobox.com>2008-09-10 15:00:17 -0700
commit628b06d7d75588bbe37dfb7ecac19d2694884d66 (patch)
tree5e00e36d09459c129c7a667810834a11b50c0244 /builtin-diff-tree.c
parentb281eea75f0ab68e3c9510323c73b78cd3e62814 (diff)
downloadgit-628b06d7d75588bbe37dfb7ecac19d2694884d66.tar.gz
Fix git-diff-tree --stdin
140b378 (Teach git diff-tree --stdin to diff trees, 2008-08-10) broke the more important case of reading series of commits to filter ones that touch given pathspecs. Noticed by Mark Levedahl, running "gitk ec3a4ba" and trying to focus on commits that touch "t/" directory. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-diff-tree.c')
-rw-r--r--builtin-diff-tree.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin-diff-tree.c b/builtin-diff-tree.c
index 1138c2da73..8ecefd4f0f 100644
--- a/builtin-diff-tree.c
+++ b/builtin-diff-tree.c
@@ -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)