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
9364f274
Commit
9364f274
authored
May 05, 2017
by
Patrick Steinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remote: test creating and fetching detached remotes
parent
34b79391
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
0 deletions
+38
-0
tests/online/remotes.c
+38
-0
No files found.
tests/online/remotes.c
View file @
9364f274
...
...
@@ -87,3 +87,41 @@ void test_online_remotes__detached_remote_fails_pushing(void)
git_remote_free
(
remote
);
}
void
test_online_remotes__detached_remote_succeeds_ls
(
void
)
{
const
char
*
refs
[]
=
{
"HEAD"
,
"refs/heads/first-merge"
,
"refs/heads/master"
,
"refs/heads/no-parent"
,
"refs/tags/annotated_tag"
,
"refs/tags/annotated_tag^{}"
,
"refs/tags/blob"
,
"refs/tags/commit_tree"
,
"refs/tags/nearly-dangling"
,
};
const
git_remote_head
**
heads
;
git_remote
*
remote
;
size_t
i
,
j
,
n
;
cl_git_pass
(
git_remote_create_detached
(
&
remote
,
URL
));
cl_git_pass
(
git_remote_connect
(
remote
,
GIT_DIRECTION_FETCH
,
NULL
,
NULL
,
NULL
));
cl_git_pass
(
git_remote_ls
(
&
heads
,
&
n
,
remote
));
cl_assert_equal_sz
(
n
,
9
);
for
(
i
=
0
;
i
<
n
;
i
++
)
{
char
found
=
false
;
for
(
j
=
0
;
j
<
ARRAY_SIZE
(
refs
);
j
++
)
{
if
(
!
strcmp
(
heads
[
i
]
->
name
,
refs
[
j
]))
{
found
=
true
;
break
;
}
}
cl_assert_
(
found
,
heads
[
i
]
->
name
);
}
git_remote_free
(
remote
);
}
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