diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2013-05-04 17:16:55 +0400 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-05-11 13:20:37 +0400 |
commit | 51fc5e895d7655611431a0bdb76b9fd8499a9e1a (patch) | |
tree | 0283022040fdd80f065fa79519e01fca5c964da9 /tests-clar/refs | |
parent | 69a3c766b6c6b9bbe2859bf8572c12b93a9d37c9 (diff) |
Make sure the ref iterator works in an repo without physical presence
Diffstat (limited to 'tests-clar/refs')
-rw-r--r-- | tests-clar/refs/iterator.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests-clar/refs/iterator.c b/tests-clar/refs/iterator.c index aef0453c8..d5555c657 100644 --- a/tests-clar/refs/iterator.c +++ b/tests-clar/refs/iterator.c @@ -74,3 +74,21 @@ void test_refs_iterator__list(void) } git_vector_free(&output); } + +void test_refs_iterator__empty(void) +{ + git_reference_iterator *iter; + git_odb *odb; + const char *name; + git_repository *empty; + + cl_git_pass(git_odb_new(&odb)); + cl_git_pass(git_repository_wrap_odb(&empty, odb)); + + cl_git_pass(git_reference_iterator_new(&iter, empty)); + cl_assert_equal_i(GIT_ITEROVER, git_reference_next(&name, iter)); + + git_reference_iterator_free(iter); + git_odb_free(odb); + git_repository_free(empty); +} |