Commit d18209eef9a7fbbccb495b6e5450d14a76623847

Carlos Martín Nieto 2014-02-01T16:27:42

revwalk: add a test for pushing all references This used to be broken, let's make sure we don't break this use-case.

diff --git a/tests/revwalk/basic.c b/tests/revwalk/basic.c
index 4d6522c..9fe8a35 100644
--- a/tests/revwalk/basic.c
+++ b/tests/revwalk/basic.c
@@ -271,3 +271,22 @@ void test_revwalk_basic__push_mixed(void)
 	/* git rev-list --count --glob=tags #=> 9 */
 	cl_assert_equal_i(9, i);
 }
+
+void test_revwalk_basic__push_all(void)
+{
+	git_oid oid;
+	int i = 0;
+
+	revwalk_basic_setup_walk(NULL);
+
+	git_revwalk_reset(_walk);
+	git_revwalk_sorting(_walk, 0);
+	cl_git_pass(git_revwalk_push_glob(_walk, "*"));
+
+	while (git_revwalk_next(&oid, _walk) == 0) {
+		i++;
+	}
+
+	/* git rev-list --count --all #=> 15 */
+	cl_assert_equal_i(15, i);
+}