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
d6d8cc27
Commit
d6d8cc27
authored
Jun 22, 2012
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests-clar: fix isolation of repo initialization tests
parent
dbb24a39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
tests-clar/repo/init.c
+17
-6
No files found.
tests-clar/repo/init.c
View file @
d6d8cc27
...
@@ -170,10 +170,21 @@ static void assert_config_entry_on_init_bytype(const char *config_key, int expec
...
@@ -170,10 +170,21 @@ static void assert_config_entry_on_init_bytype(const char *config_key, int expec
{
{
git_config
*
config
;
git_config
*
config
;
int
current_value
;
int
current_value
;
git_buf
repo_path
=
GIT_BUF_INIT
;
cl_set_cleanup
(
&
cleanup_repository
,
"config_entry"
);
cl_set_cleanup
(
&
cleanup_repository
,
"config_entry"
);
cl_git_pass
(
git_repository_init
(
&
_repo
,
"config_entry/test.git"
,
is_bare
));
cl_git_pass
(
git_buf_puts
(
&
repo_path
,
"config_entry/test."
));
if
(
!
is_bare
)
cl_git_pass
(
git_buf_puts
(
&
repo_path
,
"non."
));
cl_git_pass
(
git_buf_puts
(
&
repo_path
,
"bare.git"
));
cl_git_pass
(
git_repository_init
(
&
_repo
,
git_buf_cstr
(
&
repo_path
),
is_bare
));
git_buf_free
(
&
repo_path
);
git_repository_config
(
&
config
,
_repo
);
git_repository_config
(
&
config
,
_repo
);
if
(
expected_value
>=
0
)
{
if
(
expected_value
>=
0
)
{
...
@@ -223,7 +234,7 @@ void test_repo_init__reinit_doesnot_overwrite_ignorecase(void)
...
@@ -223,7 +234,7 @@ void test_repo_init__reinit_doesnot_overwrite_ignorecase(void)
int
current_value
;
int
current_value
;
/* Init a new repo */
/* Init a new repo */
test_repo_init__detect_ignorecase
(
);
cl_git_pass
(
git_repository_init
(
&
_repo
,
"not.overwrite.git"
,
1
)
);
/* Change the "core.ignorecase" config value to something unlikely */
/* Change the "core.ignorecase" config value to something unlikely */
git_repository_config
(
&
config
,
_repo
);
git_repository_config
(
&
config
,
_repo
);
...
@@ -232,7 +243,7 @@ void test_repo_init__reinit_doesnot_overwrite_ignorecase(void)
...
@@ -232,7 +243,7 @@ void test_repo_init__reinit_doesnot_overwrite_ignorecase(void)
git_repository_free
(
_repo
);
git_repository_free
(
_repo
);
/* Reinit the repository */
/* Reinit the repository */
cl_git_pass
(
git_repository_init
(
&
_repo
,
"
config_entry/test
.git"
,
1
));
cl_git_pass
(
git_repository_init
(
&
_repo
,
"
not.overwrite
.git"
,
1
));
git_repository_config
(
&
config
,
_repo
);
git_repository_config
(
&
config
,
_repo
);
/* Ensure the "core.ignorecase" config value hasn't been updated */
/* Ensure the "core.ignorecase" config value hasn't been updated */
...
@@ -254,7 +265,7 @@ void test_repo_init__reinit_overwrites_filemode(void)
...
@@ -254,7 +265,7 @@ void test_repo_init__reinit_overwrites_filemode(void)
#endif
#endif
/* Init a new repo */
/* Init a new repo */
cl_git_pass
(
git_repository_init
(
&
_repo
,
"
config_entry/test
.git"
,
1
));
cl_git_pass
(
git_repository_init
(
&
_repo
,
"
overwrite
.git"
,
1
));
/* Change the "core.filemode" config value to something unlikely */
/* Change the "core.filemode" config value to something unlikely */
git_repository_config
(
&
config
,
_repo
);
git_repository_config
(
&
config
,
_repo
);
...
@@ -263,7 +274,7 @@ void test_repo_init__reinit_overwrites_filemode(void)
...
@@ -263,7 +274,7 @@ void test_repo_init__reinit_overwrites_filemode(void)
git_repository_free
(
_repo
);
git_repository_free
(
_repo
);
/* Reinit the repository */
/* Reinit the repository */
cl_git_pass
(
git_repository_init
(
&
_repo
,
"
config_entry/test
.git"
,
1
));
cl_git_pass
(
git_repository_init
(
&
_repo
,
"
overwrite
.git"
,
1
));
git_repository_config
(
&
config
,
_repo
);
git_repository_config
(
&
config
,
_repo
);
/* Ensure the "core.filemode" config value has been reset */
/* Ensure the "core.filemode" config value has been reset */
...
...
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