]> git.proxmox.com Git - libgit2.git/commitdiff
Seperate out a new test that verifies packed-refs with no trailing newline
authorScott J. Goldman <scottjg@github.com>
Wed, 23 Jan 2013 00:01:03 +0000 (16:01 -0800)
committerScott J. Goldman <scottjg@github.com>
Wed, 23 Jan 2013 00:01:03 +0000 (16:01 -0800)
as per @vmg's request

tests-clar/object/tag/read.c
tests-clar/refs/listall.c

index 6dab2a9a9c60b4a874bd2c88b2652a46955d7735..16e3e63a2d2cf43d44a1f5cf9324b210fd3a8c9a 100644 (file)
@@ -62,7 +62,6 @@ void test_object_tag_read__parse_without_tagger(void)
    git_tag *bad_tag;
    git_commit *commit;
    git_oid id, id_commit;
-   git_strarray ref_list;
 
    // TODO: This is a little messy
    cl_git_pass(git_repository_open(&bad_tag_repo, cl_fixture("bad_tag.git")));
@@ -82,9 +81,7 @@ void test_object_tag_read__parse_without_tagger(void)
 
    cl_assert(git_oid_cmp(&id_commit, git_commit_id(commit)) == 0);
 
-   cl_git_pass(git_reference_list(&ref_list, bad_tag_repo, GIT_REF_LISTALL));
 
-   git_strarray_free(&ref_list);
    git_tag_free(bad_tag);
    git_commit_free(commit);
    git_repository_free(bad_tag_repo);
index 7f1de74cc47545e39158ed1ec034abfbd058e8b0..8f4c3746b3f15143df200db04cbd87e653cf9faa 100644 (file)
@@ -34,3 +34,14 @@ void test_refs_listall__from_repository_opened_through_gitdir_path(void)
 {
        ensure_no_refname_starts_with_a_forward_slash(cl_fixture("testrepo.git"));
 }
+
+void test_refs_listall__from_repository_with_no_trailing_newline(void)
+{
+       cl_git_pass(git_repository_open(&repo, cl_fixture("bad_tag.git")));
+       cl_git_pass(git_reference_list(&ref_list, repo, GIT_REF_LISTALL));
+
+       cl_assert(ref_list.count > 0);
+
+       git_strarray_free(&ref_list);
+       git_repository_free(repo);
+}