Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
2f8acdb3
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,发现更多精彩内容 >>
提交
2f8acdb3
编写于
3月 20, 2006
作者:
J
Junio C Hamano
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
core.warnambiguousrefs: warns when "name" is used and both "name" branch and tag exists.
Signed-off-by:
N
Junio C Hamano
<
junkio@cox.net
>
上级
ac749050
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
3 deletion
+27
-3
cache.h
cache.h
+1
-0
config.c
config.c
+5
-0
environment.c
environment.c
+1
-0
sha1_name.c
sha1_name.c
+20
-3
未找到文件。
cache.h
浏览文件 @
2f8acdb3
...
...
@@ -165,6 +165,7 @@ extern void rollback_index_file(struct cache_file *);
extern
int
trust_executable_bit
;
extern
int
assume_unchanged
;
extern
int
only_use_symrefs
;
extern
int
warn_ambiguous_refs
;
extern
int
diff_rename_limit_default
;
extern
int
shared_repository
;
extern
const
char
*
apply_default_whitespace
;
...
...
config.c
浏览文件 @
2f8acdb3
...
...
@@ -232,6 +232,11 @@ int git_default_config(const char *var, const char *value)
return
0
;
}
if
(
!
strcmp
(
var
,
"core.warnambiguousrefs"
))
{
warn_ambiguous_refs
=
git_config_bool
(
var
,
value
);
return
0
;
}
if
(
!
strcmp
(
var
,
"user.name"
))
{
strncpy
(
git_default_name
,
value
,
sizeof
(
git_default_name
));
return
0
;
...
...
environment.c
浏览文件 @
2f8acdb3
...
...
@@ -14,6 +14,7 @@ char git_default_name[MAX_GITNAME];
int
trust_executable_bit
=
1
;
int
assume_unchanged
=
0
;
int
only_use_symrefs
=
0
;
int
warn_ambiguous_refs
=
0
;
int
repository_format_version
=
0
;
char
git_commit_encoding
[
MAX_ENCODING_LENGTH
]
=
"utf-8"
;
int
shared_repository
=
0
;
...
...
sha1_name.c
浏览文件 @
2f8acdb3
...
...
@@ -240,9 +240,13 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
"refs"
,
"refs/tags"
,
"refs/heads"
,
"refs/remotes"
,
NULL
};
const
char
**
p
;
const
char
*
warning
=
"warning: refname '%.*s' is ambiguous.
\n
"
;
char
*
pathname
;
int
already_found
=
0
;
if
(
len
==
40
&&
!
get_sha1_hex
(
str
,
sha1
))
return
0
;
...
...
@@ -252,10 +256,23 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
return
-
1
;
for
(
p
=
prefix
;
*
p
;
p
++
)
{
char
*
pathname
=
git_path
(
"%s/%.*s"
,
*
p
,
len
,
str
);
if
(
!
read_ref
(
pathname
,
sha1
))
return
0
;
unsigned
char
sha1_from_ref
[
20
];
unsigned
char
*
this_result
=
already_found
?
sha1_from_ref
:
sha1
;
pathname
=
git_path
(
"%s/%.*s"
,
*
p
,
len
,
str
);
if
(
!
read_ref
(
pathname
,
this_result
))
{
if
(
warn_ambiguous_refs
)
{
if
(
already_found
&&
!
memcmp
(
sha1
,
sha1_from_ref
,
20
))
fprintf
(
stderr
,
warning
,
len
,
str
);
already_found
++
;
}
else
return
0
;
}
}
if
(
already_found
)
return
0
;
return
-
1
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录