aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tree-diff.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tree-diff.c b/tree-diff.c
index 467e38172..7f7ddda4e 100644
--- a/tree-diff.c
+++ b/tree-diff.c
@@ -422,8 +422,9 @@ static struct combine_diff_path *ll_diff_tree_paths(
* diff_tree_oid(parent, commit) )
*/
for (i = 0; i < nparent; ++i)
- tptree[i] = fill_tree_descriptor(&tp[i], parents_oid[i]->hash);
- ttree = fill_tree_descriptor(&t, oid->hash);
+ tptree[i] = fill_tree_descriptor(&tp[i],
+ parents_oid[i] ? parents_oid[i]->hash : NULL);
+ ttree = fill_tree_descriptor(&t, oid ? oid->hash : NULL);
/* Enable recursion indefinitely */
opt->pathspec.recursive = DIFF_OPT_TST(opt, RECURSIVE);