Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
55dcc2eb
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,发现更多精彩内容 >>
提交
55dcc2eb
编写于
1月 10, 2012
作者:
J
Junio C Hamano
浏览文件
操作
浏览文件
下载
差异文件
Merge the attributes fix in from maint-1.6.7 branch
Signed-off-by:
N
Junio C Hamano
<
gitster@pobox.com
>
上级
829a1c61
804e97fc
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
77 addition
and
33 deletion
+77
-33
Documentation/RelNotes/1.7.6.6.txt
Documentation/RelNotes/1.7.6.6.txt
+11
-0
Documentation/RelNotes/1.7.7.6.txt
Documentation/RelNotes/1.7.7.6.txt
+11
-0
Documentation/config.txt
Documentation/config.txt
+2
-1
attr.c
attr.c
+43
-32
t/t0003-attributes.sh
t/t0003-attributes.sh
+10
-0
未找到文件。
Documentation/RelNotes/1.7.6.6.txt
0 → 100644
浏览文件 @
55dcc2eb
Git v1.7.6.6 Release Notes
==========================
Fixes since v1.7.6.5
--------------------
* The code to look up attributes for paths reused entries from a wrong
directory when two paths in question are in adjacent directories and
the name of the one directory is a prefix of the other.
Also contains minor fixes and documentation updates.
Documentation/RelNotes/1.7.7.6.txt
0 → 100644
浏览文件 @
55dcc2eb
Git v1.7.7.6 Release Notes
==========================
Fixes since v1.7.7.5
--------------------
* The code to look up attributes for paths reused entries from a wrong
directory when two paths in question are in adjacent directories and
the name of the one directory is a prefix of the other.
Also contains minor fixes and documentation updates.
Documentation/config.txt
浏览文件 @
55dcc2eb
...
...
@@ -1740,7 +1740,8 @@ rerere.enabled::
conflict hunks can be resolved automatically, should they be
encountered again. By default, linkgit:git-rerere[1] is
enabled if there is an `rr-cache` directory under the
`$GIT_DIR`.
`$GIT_DIR`, e.g. if "rerere" was previously used in the
repository.
sendemail.identity::
A configuration identity. When given, causes values in the
...
...
attr.c
浏览文件 @
55dcc2eb
...
...
@@ -495,47 +495,48 @@ static int git_attr_system(void)
static
void
bootstrap_attr_stack
(
void
)
{
if
(
!
attr_stack
)
{
struct
attr_stack
*
elem
;
struct
attr_stack
*
elem
;
elem
=
read_attr_from_array
(
builtin_attr
);
elem
->
origin
=
NULL
;
elem
->
prev
=
attr_stack
;
attr_stack
=
elem
;
if
(
attr_stack
)
return
;
if
(
git_attr_system
())
{
elem
=
read_attr_from_file
(
git_etc_gitattributes
(),
1
);
if
(
elem
)
{
elem
->
origin
=
NULL
;
elem
->
prev
=
attr_stack
;
attr_stack
=
elem
;
}
}
elem
=
read_attr_from_array
(
builtin_attr
);
elem
->
origin
=
NULL
;
elem
->
prev
=
attr_stack
;
attr_stack
=
elem
;
if
(
git_attributes_file
)
{
elem
=
read_attr_from_file
(
git_attributes_file
,
1
);
if
(
elem
)
{
elem
->
origin
=
NULL
;
elem
->
prev
=
attr_stack
;
attr_stack
=
elem
;
}
if
(
git_attr_system
())
{
elem
=
read_attr_from_file
(
git_etc_gitattributes
(),
1
);
if
(
elem
)
{
elem
->
origin
=
NULL
;
elem
->
prev
=
attr_stack
;
attr_stack
=
elem
;
}
}
if
(
!
is_bare_repository
()
||
direction
==
GIT_ATTR_INDEX
)
{
elem
=
read_attr
(
GITATTRIBUTES_FILE
,
1
);
elem
->
origin
=
xstrdup
(
""
);
if
(
git_attributes_file
)
{
elem
=
read_attr_from_file
(
git_attributes_file
,
1
);
if
(
elem
)
{
elem
->
origin
=
NULL
;
elem
->
prev
=
attr_stack
;
attr_stack
=
elem
;
debug_push
(
elem
);
}
}
elem
=
read_attr_from_file
(
git_path
(
INFOATTRIBUTES_FILE
),
1
);
if
(
!
elem
)
elem
=
xcalloc
(
1
,
sizeof
(
*
elem
));
elem
->
origin
=
NULL
;
if
(
!
is_bare_repository
()
||
direction
==
GIT_ATTR_INDEX
)
{
elem
=
read_attr
(
GITATTRIBUTES_FILE
,
1
);
elem
->
origin
=
xstrdup
(
""
);
elem
->
prev
=
attr_stack
;
attr_stack
=
elem
;
debug_push
(
elem
);
}
elem
=
read_attr_from_file
(
git_path
(
INFOATTRIBUTES_FILE
),
1
);
if
(
!
elem
)
elem
=
xcalloc
(
1
,
sizeof
(
*
elem
));
elem
->
origin
=
NULL
;
elem
->
prev
=
attr_stack
;
attr_stack
=
elem
;
}
static
void
prepare_attr_stack
(
const
char
*
path
)
...
...
@@ -575,14 +576,17 @@ static void prepare_attr_stack(const char *path)
/*
* Pop the ones from directories that are not the prefix of
* the path we are checking.
* the path we are checking. Break out of the loop when we see
* the root one (whose origin is an empty string "") or the builtin
* one (whose origin is NULL) without popping it.
*/
while
(
attr_stack
&&
attr_stack
->
origin
)
{
while
(
attr_stack
->
origin
)
{
int
namelen
=
strlen
(
attr_stack
->
origin
);
elem
=
attr_stack
;
if
(
namelen
<=
dirlen
&&
!
strncmp
(
elem
->
origin
,
path
,
namelen
))
!
strncmp
(
elem
->
origin
,
path
,
namelen
)
&&
(
!
namelen
||
path
[
namelen
]
==
'/'
))
break
;
debug_pop
(
elem
);
...
...
@@ -594,8 +598,15 @@ static void prepare_attr_stack(const char *path)
* Read from parent directories and push them down
*/
if
(
!
is_bare_repository
()
||
direction
==
GIT_ATTR_INDEX
)
{
/*
* bootstrap_attr_stack() should have added, and the
* above loop should have stopped before popping, the
* root element whose attr_stack->origin is set to an
* empty string.
*/
struct
strbuf
pathbuf
=
STRBUF_INIT
;
assert
(
attr_stack
->
origin
);
while
(
1
)
{
len
=
strlen
(
attr_stack
->
origin
);
if
(
dirlen
<=
len
)
...
...
t/t0003-attributes.sh
浏览文件 @
55dcc2eb
...
...
@@ -159,6 +159,16 @@ test_expect_success 'relative paths' '
(cd b && attr_check ../a/b/g a/b/g)
'
test_expect_success
'prefixes are not confused with leading directories'
'
attr_check a_plus/g unspecified &&
cat >expect <<-\EOF &&
a/g: test: a/g
a_plus/g: test: unspecified
EOF
git check-attr test a/g a_plus/g >actual &&
test_cmp expect actual
'
test_expect_success
'core.attributesfile'
'
attr_check global unspecified &&
git config core.attributesfile "$HOME/global-gitattributes" &&
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录