Commit 8320001db7b2981ba8a4c09a9c7f3da574953602

nulltoken 2011-09-17T16:07:28

Fix a off-by-one error in the git_status_foreach tests Provided the tests fail (which they should not) and the callback is invoked too many times, this prevents the tests from segfaulting.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/tests/t18-status.c b/tests/t18-status.c
index 1995111..75cdca1 100644
--- a/tests/t18-status.c
+++ b/tests/t18-status.c
@@ -113,7 +113,7 @@ static int status_cb(const char *path, unsigned int status_flags, void *payload)
 {
 	struct status_entry_counts *counts = (struct status_entry_counts *)payload;
 
-	if (counts->entry_count > counts->expected_entry_count) {
+	if (counts->entry_count >= counts->expected_entry_count) {
 		counts->wrong_status_flags_count++;
 		goto exit;
 	}