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
c94785a9
Commit
c94785a9
authored
Nov 26, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
repository: Use `git_config` when initializing
Thanks @carlosmn!
parent
b028a898
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
14 deletions
+2
-14
src/repository.c
+2
-14
No files found.
src/repository.c
View file @
c94785a9
...
...
@@ -128,6 +128,8 @@ static int load_config_data(git_repository *repo)
if
(
error
==
GIT_SUCCESS
)
repo
->
is_bare
=
is_bare
;
/* TODO: what else can we load/cache here? */
return
GIT_SUCCESS
;
}
...
...
@@ -610,19 +612,6 @@ static int repo_init_createhead(const char *git_dir)
static
int
repo_init_config
(
const
char
*
git_dir
,
int
is_bare
)
{
char
cfg_path
[
GIT_PATH_MAX
];
git_filebuf
cfg
=
GIT_FILEBUF_INIT
;
git_path_join
(
cfg_path
,
git_dir
,
GIT_CONFIG_FILENAME_INREPO
);
git_filebuf_open
(
&
cfg
,
cfg_path
,
0
);
git_filebuf_printf
(
&
cfg
,
"[core]
\n
"
);
git_filebuf_printf
(
&
cfg
,
"
\t
bare = %s
\n
"
,
is_bare
?
"true"
:
"false"
);
git_filebuf_printf
(
&
cfg
,
"
\t
repositoryformatversion = 0
\n
"
);
return
git_filebuf_commit
(
&
cfg
,
GIT_REFS_FILE_MODE
);
/* TODO: use the config backend to write this */
#if 0
git_config
*
config
;
int
error
=
GIT_SUCCESS
;
...
...
@@ -645,7 +634,6 @@ static int repo_init_config(const char *git_dir, int is_bare)
cleanup:
git_config_free
(
config
);
return
error
;
#endif
}
static
int
repo_init_structure
(
const
char
*
git_dir
,
int
is_bare
)
...
...
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