Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
613e4e5f
G
git
项目概览
李少辉-开发者
/
git
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
git
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
613e4e5f
编写于
8月 21, 2010
作者:
J
Junio C Hamano
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'sr/local-config'
* sr/local-config: config: add --local option
上级
c3b9325f
57210a67
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
5 addition
and
2 deletion
+5
-2
builtin/config.c
builtin/config.c
+5
-2
未找到文件。
builtin/config.c
浏览文件 @
613e4e5f
...
...
@@ -20,7 +20,7 @@ static char delim = '=';
static
char
key_delim
=
' '
;
static
char
term
=
'\n'
;
static
int
use_global_config
,
use_system_config
;
static
int
use_global_config
,
use_system_config
,
use_local_config
;
static
const
char
*
given_config_file
;
static
int
actions
,
types
;
static
const
char
*
get_color_slot
,
*
get_colorbool_slot
;
...
...
@@ -51,6 +51,7 @@ static struct option builtin_config_options[] = {
OPT_GROUP
(
"Config file location"
),
OPT_BOOLEAN
(
0
,
"global"
,
&
use_global_config
,
"use global config file"
),
OPT_BOOLEAN
(
0
,
"system"
,
&
use_system_config
,
"use system config file"
),
OPT_BOOLEAN
(
0
,
"local"
,
&
use_local_config
,
"use repository config file"
),
OPT_STRING
(
'f'
,
"file"
,
&
given_config_file
,
"FILE"
,
"use given config file"
),
OPT_GROUP
(
"Action"
),
OPT_BIT
(
0
,
"get"
,
&
actions
,
"get value: name [value-regex]"
,
ACTION_GET
),
...
...
@@ -342,7 +343,7 @@ int cmd_config(int argc, const char **argv, const char *unused_prefix)
builtin_config_usage
,
PARSE_OPT_STOP_AT_NON_OPTION
);
if
(
use_global_config
+
use_system_config
+
!!
given_config_file
>
1
)
{
if
(
use_global_config
+
use_system_config
+
use_local_config
+
!!
given_config_file
>
1
)
{
error
(
"only one config file at a time."
);
usage_with_options
(
builtin_config_usage
,
builtin_config_options
);
}
...
...
@@ -358,6 +359,8 @@ int cmd_config(int argc, const char **argv, const char *unused_prefix)
}
else
if
(
use_system_config
)
config_exclusive_filename
=
git_etc_gitconfig
();
else
if
(
use_local_config
)
config_exclusive_filename
=
git_pathdup
(
"config"
);
else
if
(
given_config_file
)
{
if
(
!
is_absolute_path
(
given_config_file
)
&&
prefix
)
config_exclusive_filename
=
prefix_filename
(
prefix
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录