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
0a1c8f55
Commit
0a1c8f55
authored
Jul 11, 2013
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preload configuration paths
parent
f2de67d5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
5 deletions
+25
-5
src/fileops.c
+14
-0
src/fileops.h
+7
-0
src/global.c
+4
-5
No files found.
src/fileops.c
View file @
0a1c8f55
...
@@ -627,6 +627,20 @@ static git_futils_dirs_guess_cb git_futils__dir_guess[GIT_FUTILS_DIR__MAX] = {
...
@@ -627,6 +627,20 @@ static git_futils_dirs_guess_cb git_futils__dir_guess[GIT_FUTILS_DIR__MAX] = {
git_futils_guess_xdg_dirs
,
git_futils_guess_xdg_dirs
,
};
};
int
git_futils_dirs_global_init
(
void
)
{
git_futils_dir_t
i
;
git_buf
*
path
;
int
error
=
0
;
for
(
i
=
0
;
i
<
GIT_FUTILS_DIR__MAX
;
i
++
)
{
if
((
error
=
git_futils_dirs_get
(
&
path
,
i
))
<
0
)
break
;
}
return
error
;
}
static
int
git_futils_check_selector
(
git_futils_dir_t
which
)
static
int
git_futils_check_selector
(
git_futils_dir_t
which
)
{
{
if
(
which
<
GIT_FUTILS_DIR__MAX
)
if
(
which
<
GIT_FUTILS_DIR__MAX
)
...
...
src/fileops.h
View file @
0a1c8f55
...
@@ -310,6 +310,13 @@ typedef enum {
...
@@ -310,6 +310,13 @@ typedef enum {
}
git_futils_dir_t
;
}
git_futils_dir_t
;
/**
/**
* Configures global data for configuration file search paths.
*
* @return 0 on success, <0 on failure
*/
extern
int
git_futils_dirs_global_init
(
void
);
/**
* Get the search path for global/system/xdg files
* Get the search path for global/system/xdg files
*
*
* @param out pointer to git_buf containing search path
* @param out pointer to git_buf containing search path
...
...
src/global.c
View file @
0a1c8f55
...
@@ -65,10 +65,8 @@ int git_threads_init(void)
...
@@ -65,10 +65,8 @@ int git_threads_init(void)
return
-
1
;
return
-
1
;
/* Initialize any other subsystems that have global state */
/* Initialize any other subsystems that have global state */
if
((
error
=
git_hash_global_init
())
>=
0
)
if
((
error
=
git_hash_global_init
())
>=
0
&&
_tls_init
=
1
;
(
error
=
git_futils_dirs_global_init
())
>=
0
)
if
(
error
==
0
)
_tls_init
=
1
;
_tls_init
=
1
;
GIT_MEMORY_BARRIER
;
GIT_MEMORY_BARRIER
;
...
@@ -127,7 +125,8 @@ int git_threads_init(void)
...
@@ -127,7 +125,8 @@ int git_threads_init(void)
pthread_key_create
(
&
_tls_key
,
&
cb__free_status
);
pthread_key_create
(
&
_tls_key
,
&
cb__free_status
);
/* Initialize any other subsystems that have global state */
/* Initialize any other subsystems that have global state */
if
((
error
=
git_hash_global_init
())
>=
0
)
if
((
error
=
git_hash_global_init
())
>=
0
&&
(
error
=
git_futils_dirs_global_init
())
>=
0
)
_tls_init
=
1
;
_tls_init
=
1
;
GIT_MEMORY_BARRIER
;
GIT_MEMORY_BARRIER
;
...
...
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