Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
8deea589
Commit
8deea589
authored
Sep 02, 2014
by
Linquize
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add network::fetchlocal multi remotes test
parent
f49819aa
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
tests/network/fetchlocal.c
+34
-0
No files found.
tests/network/fetchlocal.c
View file @
8deea589
...
...
@@ -127,3 +127,37 @@ void test_network_fetchlocal__clone_into_mirror(void)
git_repository_free
(
repo
);
cl_fixture_cleanup
(
"./foo.git"
);
}
void
test_network_fetchlocal__multi_remotes
(
void
)
{
git_repository
*
repo
=
cl_git_sandbox_init
(
"testrepo.git"
);
git_remote
*
test
,
*
test2
;
git_strarray
refnames
=
{
0
};
git_remote_callbacks
callbacks
=
GIT_REMOTE_CALLBACKS_INIT
;
callbacks
.
transfer_progress
=
transfer_cb
;
cl_git_pass
(
git_remote_load
(
&
test
,
repo
,
"test"
));
cl_git_pass
(
git_remote_set_url
(
test
,
cl_git_fixture_url
(
"testrepo.git"
)));
git_remote_set_callbacks
(
test
,
&
callbacks
);
cl_git_pass
(
git_remote_connect
(
test
,
GIT_DIRECTION_FETCH
));
cl_git_pass
(
git_remote_download
(
test
));
cl_git_pass
(
git_remote_update_tips
(
test
,
NULL
,
NULL
));
cl_git_pass
(
git_reference_list
(
&
refnames
,
repo
));
cl_assert_equal_i
(
32
,
(
int
)
refnames
.
count
);
cl_git_pass
(
git_remote_load
(
&
test2
,
repo
,
"test_with_pushurl"
));
cl_git_pass
(
git_remote_set_url
(
test2
,
cl_git_fixture_url
(
"testrepo.git"
)));
git_remote_set_callbacks
(
test2
,
&
callbacks
);
cl_git_pass
(
git_remote_connect
(
test2
,
GIT_DIRECTION_FETCH
));
cl_git_pass
(
git_remote_download
(
test2
));
cl_git_pass
(
git_remote_update_tips
(
test2
,
NULL
,
NULL
));
cl_git_pass
(
git_reference_list
(
&
refnames
,
repo
));
cl_assert_equal_i
(
44
,
(
int
)
refnames
.
count
);
git_strarray_free
(
&
refnames
);
git_remote_free
(
test
);
git_remote_free
(
test2
);
git_repository_free
(
repo
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment