diff options
-rw-r--r-- | builtin-diff-tree.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/builtin-diff-tree.c b/builtin-diff-tree.c index cc53b81ac4..58cf65856d 100644 --- a/builtin-diff-tree.c +++ b/builtin-diff-tree.c @@ -138,11 +138,15 @@ int cmd_diff_tree(int argc, const char **argv, char **envp) if (opt->diffopt.detect_rename) opt->diffopt.setup |= (DIFF_SETUP_USE_SIZE_CACHE | DIFF_SETUP_USE_CACHE); - while (fgets(line, sizeof(line), stdin)) - if (line[0] == '\n') + while (fgets(line, sizeof(line), stdin)) { + unsigned char sha1[20]; + + if (get_sha1_hex(line, sha1)) { + fputs(line, stdout); fflush(stdout); + } else diff_tree_stdin(line); - + } return 0; } |