Commit d8289b9fb416cfe4f83eeb38fe324c077bada3e4

Carlos Martín Nieto 2013-08-09T11:03:13

config: handle empty backends when iterating

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/config.c b/src/config.c
index 3881d73..061765a 100644
--- a/src/config.c
+++ b/src/config.c
@@ -375,7 +375,12 @@ static int all_iter_next(git_config_entry **entry, git_config_iterator *_iter)
 		if (error < 0)
 			return error;
 
-		return iter->current->next(entry, iter->current);
+		error = iter->current->next(entry, iter->current);
+		/* If this backend is empty, then keep going */
+		if (error == GIT_ITEROVER)
+			continue;
+
+		return error;
 
 	} while(1);