summaryrefslogtreecommitdiffabout
path: root/shared.c
Unidiff
Diffstat (limited to 'shared.c') (more/less context) (ignore whitespace changes)
-rw-r--r--shared.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/shared.c b/shared.c
index c7cd8a5..f20fb5c 100644
--- a/shared.c
+++ b/shared.c
@@ -357,13 +357,13 @@ void cgit_diff_tree(const unsigned char *old_sha1,
357 opt.detect_rename = 1; 357 opt.detect_rename = 1;
358 opt.recursive = 1; 358 opt.recursive = 1;
359 opt.format_callback = cgit_diff_tree_cb; 359 opt.format_callback = cgit_diff_tree_cb;
360 opt.format_callback_data = fn; 360 opt.format_callback_data = fn;
361 diff_setup_done(&opt); 361 diff_setup_done(&opt);
362 362
363 if (old_sha1) 363 if (old_sha1 && !is_null_sha1(old_sha1))
364 ret = diff_tree_sha1(old_sha1, new_sha1, "", &opt); 364 ret = diff_tree_sha1(old_sha1, new_sha1, "", &opt);
365 else 365 else
366 ret = diff_root_tree_sha1(new_sha1, "", &opt); 366 ret = diff_root_tree_sha1(new_sha1, "", &opt);
367 diffcore_std(&opt); 367 diffcore_std(&opt);
368 diff_flush(&opt); 368 diff_flush(&opt);
369} 369}