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
04d4fe5e
Commit
04d4fe5e
authored
Aug 29, 2012
by
Russell Belfer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #908 from nulltoken/bug/repo_reinit_init
repository: add failing repo initialization test
parents
319ad0ba
89cd5708
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
src/repository.c
+2
-2
tests-clar/repo/init.c
+15
-0
No files found.
src/repository.c
View file @
04d4fe5e
...
...
@@ -777,8 +777,8 @@ static int repo_init_config(
SET_REPO_CONFIG
(
string
,
"core.worktree"
,
work_dir
);
}
else
if
((
opts
->
flags
&
GIT_REPOSITORY_INIT__IS_REINIT
)
!=
0
)
{
if
(
(
error
=
git_config_delete
(
config
,
"core.worktree"
)
)
<
0
)
g
oto
cleanup
;
if
(
git_config_delete
(
config
,
"core.worktree"
)
<
0
)
g
iterr_clear
()
;
}
}
else
{
if
(
!
are_symlinks_supported
(
repo_dir
))
...
...
tests-clar/repo/init.c
View file @
04d4fe5e
...
...
@@ -378,3 +378,18 @@ void test_repo_init__extended_with_template(void)
cleanup_repository
(
"templated.git"
);
}
void
test_repo_init__can_reinit_an_initialized_repository
(
void
)
{
git_repository
*
reinit
;
cl_git_pass
(
git_futils_mkdir
(
"extended"
,
NULL
,
0775
,
0
));
cl_git_pass
(
git_repository_init
(
&
_repo
,
"extended"
,
false
));
cl_git_pass
(
git_repository_init
(
&
reinit
,
"extended"
,
false
));
cl_assert_equal_s
(
git_repository_path
(
_repo
),
git_repository_path
(
reinit
));
git_repository_free
(
reinit
);
cleanup_repository
(
"extended"
);
}
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