diff options
author | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-02-28 01:00:49 +0400 |
---|---|---|
committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2012-02-28 01:07:20 +0400 |
commit | f0fa1c1a73f5a19a9799c0f8b90dcd533154cb3a (patch) | |
tree | ebe485f0d86c539b68a73418b8e3586ed9b91a73 /tests-clar/revwalk | |
parent | 155aca2da79c8cae650c4e4f387a40d8f0a66527 (diff) |
Add revwalk glob test
Diffstat (limited to 'tests-clar/revwalk')
-rw-r--r-- | tests-clar/revwalk/basic.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests-clar/revwalk/basic.c b/tests-clar/revwalk/basic.c index 5907c2443..f013945ff 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); +} |