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
4258d483
Commit
4258d483
authored
Oct 02, 2012
by
Sven Strickroth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename xdr to xdg
Signed-off-by: Sven Strickroth <email@cs-ware.de>
parent
8b3de0b6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
21 deletions
+21
-21
include/git2/config.h
+7
-7
src/config.c
+5
-5
src/config.h
+1
-1
src/repository.c
+8
-8
No files found.
include/git2/config.h
View file @
4258d483
...
...
@@ -61,7 +61,7 @@ typedef struct {
* may be used on any `git_config` call to load the
* global configuration file.
*
* This method will not guess the path to the xd
r
compatible
* This method will not guess the path to the xd
g
compatible
* config file (.config/git/config).
*
* @param global_config_path Buffer of GIT_PATH_MAX length to store the path
...
...
@@ -71,21 +71,21 @@ typedef struct {
GIT_EXTERN
(
int
)
git_config_find_global
(
char
*
global_config_path
,
size_t
length
);
/**
* Locate the path to the global xd
r
compatible configuration file
* Locate the path to the global xd
g
compatible configuration file
*
* The xd
r
compatible configuration file is usually
* The xd
g
compatible configuration file is usually
* located in `$HOME/.config/git/config`.
*
* This method will try to guess the full path to that
* file, if the file exists. The returned path
* may be used on any `git_config` call to load the
*
global
configuration file.
*
xdg compatible
configuration file.
*
* @param
global
_config_path Buffer of GIT_PATH_MAX length to store the path
* @return 0 if a
global
configuration file has been
* @param
xdg
_config_path Buffer of GIT_PATH_MAX length to store the path
* @return 0 if a
xdg compatible
configuration file has been
* found. Its path will be stored in `buffer`.
*/
GIT_EXTERN
(
int
)
git_config_find_xd
r
(
char
*
global
_config_path
,
size_t
length
);
GIT_EXTERN
(
int
)
git_config_find_xd
g
(
char
*
xdg
_config_path
,
size_t
length
);
/**
* Locate the path to the system configuration file
...
...
src/config.c
View file @
4258d483
...
...
@@ -454,7 +454,7 @@ int git_config_find_global_r(git_buf *path)
return
error
;
}
int
git_config_find_xd
r
_r
(
git_buf
*
path
)
int
git_config_find_xd
g
_r
(
git_buf
*
path
)
{
int
error
=
git_futils_find_global_file
(
path
,
GIT_CONFIG_FILENAME_ALT
);
...
...
@@ -483,10 +483,10 @@ int git_config_find_global(char *global_config_path, size_t length)
return
0
;
}
int
git_config_find_xd
r
(
char
*
xdr
_config_path
,
size_t
length
)
int
git_config_find_xd
g
(
char
*
xdg
_config_path
,
size_t
length
)
{
git_buf
path
=
GIT_BUF_INIT
;
int
ret
=
git_config_find_xd
r
_r
(
&
path
);
int
ret
=
git_config_find_xd
g
_r
(
&
path
);
if
(
ret
<
0
)
{
git_buf_free
(
&
path
);
...
...
@@ -500,7 +500,7 @@ int git_config_find_xdr(char *xdr_config_path, size_t length)
return
-
1
;
}
git_buf_copy_cstr
(
xd
r
_config_path
,
length
,
&
path
);
git_buf_copy_cstr
(
xd
g
_config_path
,
length
,
&
path
);
git_buf_free
(
&
path
);
return
0
;
}
...
...
@@ -543,7 +543,7 @@ int git_config_open_default(git_config **out)
if
(
!
error
&&
!
git_config_find_global_r
(
&
buf
))
error
=
git_config_add_file_ondisk
(
cfg
,
buf
.
ptr
,
3
);
if
(
!
error
&&
!
git_config_find_xd
r
_r
(
&
buf
))
if
(
!
error
&&
!
git_config_find_xd
g
_r
(
&
buf
))
error
=
git_config_add_file_ondisk
(
cfg
,
buf
.
ptr
,
2
);
if
(
!
error
&&
!
git_config_find_system_r
(
&
buf
))
...
...
src/config.h
View file @
4258d483
...
...
@@ -24,7 +24,7 @@ struct git_config {
};
extern
int
git_config_find_global_r
(
git_buf
*
global_config_path
);
extern
int
git_config_find_xd
r
_r
(
git_buf
*
system_config_path
);
extern
int
git_config_find_xd
g
_r
(
git_buf
*
system_config_path
);
extern
int
git_config_find_system_r
(
git_buf
*
system_config_path
);
extern
int
git_config_parse_bool
(
int
*
out
,
const
char
*
bool_string
);
...
...
src/repository.c
View file @
4258d483
...
...
@@ -445,7 +445,7 @@ static int load_config(
git_config
**
out
,
git_repository
*
repo
,
const
char
*
global_config_path
,
const
char
*
xd
r
_config_path
,
const
char
*
xd
g
_config_path
,
const
char
*
system_config_path
)
{
git_buf
config_path
=
GIT_BUF_INIT
;
...
...
@@ -470,8 +470,8 @@ static int load_config(
goto
on_error
;
}
if
(
xd
r
_config_path
!=
NULL
)
{
if
(
git_config_add_file_ondisk
(
cfg
,
xd
r
_config_path
,
2
)
<
0
)
if
(
xd
g
_config_path
!=
NULL
)
{
if
(
git_config_add_file_ondisk
(
cfg
,
xd
g
_config_path
,
2
)
<
0
)
goto
on_error
;
}
...
...
@@ -493,23 +493,23 @@ on_error:
int
git_repository_config__weakptr
(
git_config
**
out
,
git_repository
*
repo
)
{
if
(
repo
->
_config
==
NULL
)
{
git_buf
global_buf
=
GIT_BUF_INIT
,
xd
r
_buf
=
GIT_BUF_INIT
,
system_buf
=
GIT_BUF_INIT
;
git_buf
global_buf
=
GIT_BUF_INIT
,
xd
g
_buf
=
GIT_BUF_INIT
,
system_buf
=
GIT_BUF_INIT
;
int
res
;
const
char
*
global_config_path
=
NULL
;
const
char
*
xd
r
_config_path
=
NULL
;
const
char
*
xd
g
_config_path
=
NULL
;
const
char
*
system_config_path
=
NULL
;
if
(
git_config_find_global_r
(
&
global_buf
)
==
0
)
global_config_path
=
global_buf
.
ptr
;
if
(
git_config_find_xd
r_r
(
&
xdr
_buf
)
==
0
)
xd
r_config_path
=
xdr
_buf
.
ptr
;
if
(
git_config_find_xd
g_r
(
&
xdg
_buf
)
==
0
)
xd
g_config_path
=
xdg
_buf
.
ptr
;
if
(
git_config_find_system_r
(
&
system_buf
)
==
0
)
system_config_path
=
system_buf
.
ptr
;
res
=
load_config
(
&
repo
->
_config
,
repo
,
global_config_path
,
xd
r
_config_path
,
system_config_path
);
res
=
load_config
(
&
repo
->
_config
,
repo
,
global_config_path
,
xd
g
_config_path
,
system_config_path
);
git_buf_free
(
&
global_buf
);
git_buf_free
(
&
system_buf
);
...
...
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