commit - f71823372787764c1a09b0b2a3515dd41b077f2d
commit + b74c76254a0262d7eca704ebdb9e3bbb1d6fecb2
blob - f0adc78ea7549c48ef078033c86f8e80e13d9db3
blob + 6d774945f4b0453d42901b53c79698525b6932f9
--- lib/diff.c
+++ lib/diff.c
{
const struct got_error *err;
struct got_blob_object *blob1 = NULL, *blob2 = NULL;
+
+ if (obj1 == NULL && obj2 == NULL)
+ return got_error(GOT_ERR_NO_OBJ);
if (obj1) {
err = got_object_blob_open(&blob1, repo, obj1, 8192);
const struct got_error *err;
struct got_tree_object *tree1 = NULL, *tree2 = NULL;
+ if (obj1 == NULL && obj2 == NULL)
+ return got_error(GOT_ERR_NO_OBJ);
+
if (obj1) {
err = got_object_tree_open(&tree1, repo, obj1);
if (err)
struct got_commit_object *commit1 = NULL, *commit2 = NULL;
struct got_object *tree_obj1 = NULL, *tree_obj2 = NULL;
+ if (obj1 == NULL && obj2 == NULL)
+ return got_error(GOT_ERR_NO_OBJ);
+
if (obj1) {
err = got_object_commit_open(&commit1, repo, obj1);
if (err)