diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2012-04-06 15:23:18 +0200 |
|---|---|---|
| committer | nulltoken <emeric.fermas@gmail.com> | 2012-04-10 21:39:01 +0200 |
| commit | 79fd42301e80c1f787ee9e9b83dc5159ae12854a (patch) | |
| tree | af309ff77d1fae20130423f6b40d74369d3fe054 /tests-clar/network | |
| parent | 3f46f313cbfcf57e5cbf3d7dc55b747568a21bef (diff) | |
| download | libgit2-79fd42301e80c1f787ee9e9b83dc5159ae12854a.tar.gz | |
transport/local: Fix peeling of nested tags
Diffstat (limited to 'tests-clar/network')
| -rw-r--r-- | tests-clar/network/remotelocal.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests-clar/network/remotelocal.c b/tests-clar/network/remotelocal.c index 74a0b57aa..e154226d9 100644 --- a/tests-clar/network/remotelocal.c +++ b/tests-clar/network/remotelocal.c @@ -71,6 +71,16 @@ static int count_ref__cb(git_remote_head *head, void *payload) return GIT_SUCCESS; } +static int ensure_peeled__cb(git_remote_head *head, void *payload) +{ + GIT_UNUSED(payload); + + if(strcmp(head->name, "refs/tags/test^{}") != 0) + return 0; + + return git_oid_streq(&head->oid, "e90810b8df3e80c413d903f631643c716887138d"); +} + static void connect_to_local_repository(const char *local_repository) { build_local_file_url(&file_path_buf, local_repository); @@ -104,5 +114,15 @@ void test_network_remotelocal__retrieve_advertised_references_from_spaced_reposi cl_assert(how_many_refs == 14); /* 1 HEAD + 6 heads + 1 lightweight tag + 3 annotated tags + 3 peeled target */ + git_remote_free(remote); /* Disconnect from the "spaced repo" before the cleanup */ + remote = NULL; + cl_fixture_cleanup("spaced testrepo.git"); } + +void test_network_remotelocal__nested_tags_are_completely_peeled(void) +{ + connect_to_local_repository(cl_fixture("testrepo.git")); + + cl_git_pass(git_remote_ls(remote, &ensure_peeled__cb, NULL)); +} |
