Commit f0fa1c1a73f5a19a9799c0f8b90dcd533154cb3a

Carlos Martín Nieto 2012-02-27T22:00:49

Add revwalk glob test

diff --git a/tests-clar/revwalk/basic.c b/tests-clar/revwalk/basic.c
index 5907c24..f013945 100644
--- a/tests-clar/revwalk/basic.c
+++ b/tests-clar/revwalk/basic.c
@@ -117,3 +117,18 @@ void test_revwalk_basic__sorting_modes(void)
 	cl_git_pass(test_walk(_walk, &id, GIT_SORT_TIME | GIT_SORT_REVERSE, commit_sorting_time_reverse, 1));
 	cl_git_pass(test_walk(_walk, &id, GIT_SORT_TOPOLOGICAL | GIT_SORT_REVERSE, commit_sorting_topo_reverse, 2));
 }
+
+void test_revwalk_basic__glob_heads(void)
+{
+	int i = 0;
+	git_oid oid;
+
+	cl_git_pass(git_revwalk_push_glob(_walk, "heads"));
+
+	while (git_revwalk_next(&oid, _walk) == GIT_SUCCESS) {
+		i++;
+	}
+
+	/* git log --branches --oneline | wc -l => 13 */
+	cl_assert(i == 13);
+}