Commit e20293f22c3b2a1b5215653937598f272b1ce627

Stefan Sperling 2018-11-17T16:35:27

revert previous; it made a wrong assumption and broke diff

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/lib/diff.c b/lib/diff.c
index af94e1b..be49c12 100644
--- a/lib/diff.c
+++ b/lib/diff.c
@@ -162,13 +162,7 @@ match_entry_by_name(struct got_tree_entry *te1, struct got_tree_object *tree2)
 
 	entries2 = got_object_tree_get_entries(tree2); 
 	SIMPLEQ_FOREACH(te2, &entries2->head, entry) {
-		/* Note that tree entries are sorted in strcmp() order. */
-		int cmp = strcmp(te1->name, te2->name);
-		if (cmp < 0)
-			continue;
-		else if (cmp > 0)
-			break;
-		else
+		if (strcmp(te1->name, te2->name) == 0)
 			return te2;
 	}
 	return NULL;