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
796fa0dd
Commit
796fa0dd
authored
Jan 16, 2022
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sysdir: allow resetting cached system dirs
parent
7fd5dfa0
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
src/sysdir.c
+16
-0
src/sysdir.h
+5
-0
No files found.
src/sysdir.c
View file @
796fa0dd
...
...
@@ -189,9 +189,25 @@ int git_sysdir_global_init(void)
for
(
i
=
0
;
!
error
&&
i
<
ARRAY_SIZE
(
git_sysdir__dirs
);
i
++
)
error
=
git_sysdir__dirs
[
i
].
guess
(
&
git_sysdir__dirs
[
i
].
buf
);
if
(
error
)
return
error
;
return
git_runtime_shutdown_register
(
git_sysdir_global_shutdown
);
}
int
git_sysdir_reset
(
void
)
{
size_t
i
;
int
error
=
0
;
for
(
i
=
0
;
!
error
&&
i
<
ARRAY_SIZE
(
git_sysdir__dirs
);
++
i
)
{
git_str_dispose
(
&
git_sysdir__dirs
[
i
].
buf
);
error
=
git_sysdir__dirs
[
i
].
guess
(
&
git_sysdir__dirs
[
i
].
buf
);
}
return
error
;
}
static
int
git_sysdir_check_selector
(
git_sysdir_t
which
)
{
if
(
which
<
ARRAY_SIZE
(
git_sysdir__dirs
))
...
...
src/sysdir.h
View file @
796fa0dd
...
...
@@ -105,4 +105,9 @@ extern int git_sysdir_get(const git_str **out, git_sysdir_t which);
*/
extern
int
git_sysdir_set
(
git_sysdir_t
which
,
const
char
*
paths
);
/**
* Reset search paths for global/system/xdg files.
*/
extern
int
git_sysdir_reset
(
void
);
#endif
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