notes: don't access hash of NULL object_id pointer
[gitweb.git] / builtin / diff.c
index 73b4ff3db28d5653e0d0dd2d8d60bbf3ca4c6748..4c6a1a962fa3f86cf7c17870eadf2f97f46d875a 100644 (file)
@@ -174,7 +174,7 @@ static int builtin_diff_tree(struct rev_info *revs,
                swap = 1;
        oid[swap] = &ent0->item->oid;
        oid[1 - swap] = &ent1->item->oid;
-       diff_tree_sha1(oid[0]->hash, oid[1]->hash, "", &revs->diffopt);
+       diff_tree_oid(oid[0], oid[1], "", &revs->diffopt);
        log_tree_diff_flush(revs);
        return 0;
 }