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
f46769e5
Commit
f46769e5
authored
Jan 03, 2013
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix network suite
parent
afb18116
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
16 deletions
+4
-16
tests-clar/clar
+1
-1
tests-clar/clone/nonetwork.c
+3
-15
No files found.
clar
@
75254eeb
Subproject commit
3f99b7f36ffa2b0965eefd04abac998fa37ced23
Subproject commit
75254eeb042e8a6f83775c452b2b59da20e50bda
tests-clar/clone/nonetwork.c
View file @
f46769e5
...
@@ -20,17 +20,13 @@ void test_clone_nonetwork__initialize(void)
...
@@ -20,17 +20,13 @@ void test_clone_nonetwork__initialize(void)
void
test_clone_nonetwork__cleanup
(
void
)
void
test_clone_nonetwork__cleanup
(
void
)
{
{
git_remote_free
(
g_origin
);
}
static
void
cleanup_repository
(
void
*
path
)
{
if
(
g_repo
)
{
if
(
g_repo
)
{
git_repository_free
(
g_repo
);
git_repository_free
(
g_repo
);
g_repo
=
NULL
;
g_repo
=
NULL
;
}
}
cl_fixture_cleanup
((
const
char
*
)
path
);
cl_fixture_cleanup
(
"./foo"
);
git_remote_free
(
g_origin
);
}
}
void
test_clone_nonetwork__bad_url
(
void
)
void
test_clone_nonetwork__bad_url
(
void
)
...
@@ -48,7 +44,6 @@ void test_clone_nonetwork__bad_url(void)
...
@@ -48,7 +44,6 @@ void test_clone_nonetwork__bad_url(void)
void
test_clone_nonetwork__local
(
void
)
void
test_clone_nonetwork__local
(
void
)
{
{
cl_set_cleanup
(
&
cleanup_repository
,
"./foo"
);
cl_git_pass
(
git_clone
(
&
g_repo
,
g_origin
,
"./foo"
,
&
g_options
));
cl_git_pass
(
git_clone
(
&
g_repo
,
g_origin
,
"./foo"
,
&
g_options
));
}
}
...
@@ -56,32 +51,25 @@ void test_clone_nonetwork__local_absolute_path(void)
...
@@ -56,32 +51,25 @@ void test_clone_nonetwork__local_absolute_path(void)
{
{
const
char
*
local_src
=
cl_fixture
(
"testrepo.git"
);
const
char
*
local_src
=
cl_fixture
(
"testrepo.git"
);
git_remote_free
(
g_origin
);
git_remote_free
(
g_origin
);
cl_git_pass
(
git_remote_new
(
&
g_origin
,
NULL
,
"origin"
,
local_src
,
GIT_REMOTE_DEFAULT_FETCH
));
cl_set_cleanup
(
&
cleanup_repository
,
"./foo"
);
cl_git_pass
(
git_remote_new
(
&
g_origin
,
NULL
,
"origin"
,
local_src
,
GIT_REMOTE_DEFAULT_FETCH
));
cl_git_pass
(
git_clone
(
&
g_repo
,
g_origin
,
"./foo"
,
&
g_options
));
cl_git_pass
(
git_clone
(
&
g_repo
,
g_origin
,
"./foo"
,
&
g_options
));
}
}
void
test_clone_nonetwork__local_bare
(
void
)
void
test_clone_nonetwork__local_bare
(
void
)
{
{
cl_set_cleanup
(
&
cleanup_repository
,
"./foo"
);
g_options
.
bare
=
true
;
g_options
.
bare
=
true
;
cl_git_pass
(
git_clone
(
&
g_repo
,
g_origin
,
"./foo"
,
&
g_options
));
cl_git_pass
(
git_clone
(
&
g_repo
,
g_origin
,
"./foo"
,
&
g_options
));
}
}
void
test_clone_nonetwork__fail_when_the_target_is_a_file
(
void
)
void
test_clone_nonetwork__fail_when_the_target_is_a_file
(
void
)
{
{
cl_set_cleanup
(
&
cleanup_repository
,
"./foo"
);
cl_git_mkfile
(
"./foo"
,
"Bar!"
);
cl_git_mkfile
(
"./foo"
,
"Bar!"
);
cl_git_fail
(
git_clone
(
&
g_repo
,
g_origin
,
"./foo"
,
&
g_options
));
cl_git_fail
(
git_clone
(
&
g_repo
,
g_origin
,
"./foo"
,
&
g_options
));
}
}
void
test_clone_nonetwork__fail_with_already_existing_but_non_empty_directory
(
void
)
void
test_clone_nonetwork__fail_with_already_existing_but_non_empty_directory
(
void
)
{
{
cl_set_cleanup
(
&
cleanup_repository
,
"./foo"
);
p_mkdir
(
"./foo"
,
GIT_DIR_MODE
);
p_mkdir
(
"./foo"
,
GIT_DIR_MODE
);
cl_git_mkfile
(
"./foo/bar"
,
"Baz!"
);
cl_git_mkfile
(
"./foo/bar"
,
"Baz!"
);
cl_git_fail
(
git_clone
(
&
g_repo
,
g_origin
,
"./foo"
,
&
g_options
));
cl_git_fail
(
git_clone
(
&
g_repo
,
g_origin
,
"./foo"
,
&
g_options
));
...
...
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