Commit 4209f7906dd87a54d8efb26b7180f94272d4255a

Stefan Sperling 2017-11-30T01:43:44

fix logic error

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/lib/diff.c b/lib/diff.c
index 5588ba0..8672748 100644
--- a/lib/diff.c
+++ b/lib/diff.c
@@ -191,10 +191,10 @@ diff_entry_old_new(struct got_tree_entry *te1, struct got_tree_object *tree2)
 		return diff_deleted_blob(&te1->id);
 	}
 
-	if (S_ISDIR(te1->mode) == S_ISDIR(te2->mode)) {
+	if (S_ISDIR(te1->mode) && S_ISDIR(te2->mode)) {
 		if (!same_id(&te1->id, &te2->id))
 			return diff_modified_tree(&te1->id, &te2->id);
-	} else if (S_ISREG(te1->mode) == S_ISREG(te2->mode)) {
+	} else if (S_ISREG(te1->mode) && S_ISREG(te2->mode)) {
 		if (!same_id(&te1->id, &te2->id))
 			return diff_modified_blob(&te1->id, &te2->id);
 	} else