Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
f54cb059
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,发现更多精彩内容 >>
提交
f54cb059
编写于
9月 04, 2015
作者:
J
Junio C Hamano
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'jk/long-paths' into maint-2.2
上级
fdf96a20
78f23bdf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
27 addition
and
24 deletion
+27
-24
builtin/show-branch.c
builtin/show-branch.c
+4
-2
notes.c
notes.c
+10
-9
sha1_file.c
sha1_file.c
+3
-6
unpack-trees.c
unpack-trees.c
+10
-7
未找到文件。
builtin/show-branch.c
浏览文件 @
f54cb059
...
...
@@ -720,7 +720,6 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
if
(
reflog
)
{
unsigned
char
sha1
[
20
];
char
nth_desc
[
256
];
char
*
ref
;
int
base
=
0
;
unsigned
int
flags
=
0
;
...
...
@@ -759,6 +758,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
for
(
i
=
0
;
i
<
reflog
;
i
++
)
{
char
*
logmsg
;
char
*
nth_desc
;
const
char
*
msg
;
unsigned
long
timestamp
;
int
tz
;
...
...
@@ -777,8 +777,10 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
show_date
(
timestamp
,
tz
,
1
),
msg
);
free
(
logmsg
);
sprintf
(
nth_desc
,
"%s@{%d}"
,
*
av
,
base
+
i
);
nth_desc
=
xstrfmt
(
"%s@{%d}"
,
*
av
,
base
+
i
);
append_ref
(
nth_desc
,
sha1
,
1
);
free
(
nth_desc
);
}
free
(
ref
);
}
...
...
notes.c
浏览文件 @
f54cb059
...
...
@@ -362,13 +362,14 @@ static int non_note_cmp(const struct non_note *a, const struct non_note *b)
return
strcmp
(
a
->
path
,
b
->
path
);
}
static
void
add_non_note
(
struct
notes_tree
*
t
,
const
char
*
path
,
/* note: takes ownership of path string */
static
void
add_non_note
(
struct
notes_tree
*
t
,
char
*
path
,
unsigned
int
mode
,
const
unsigned
char
*
sha1
)
{
struct
non_note
*
p
=
t
->
prev_non_note
,
*
n
;
n
=
(
struct
non_note
*
)
xmalloc
(
sizeof
(
struct
non_note
));
n
->
next
=
NULL
;
n
->
path
=
xstrdup
(
path
)
;
n
->
path
=
path
;
n
->
mode
=
mode
;
hashcpy
(
n
->
sha1
,
sha1
);
t
->
prev_non_note
=
n
;
...
...
@@ -482,17 +483,17 @@ static void load_subtree(struct notes_tree *t, struct leaf_node *subtree,
* component.
*/
{
char
non_note_path
[
PATH_MAX
];
char
*
p
=
non_note_path
;
struct
strbuf
non_note_path
=
STRBUF_INIT
;
const
char
*
q
=
sha1_to_hex
(
subtree
->
key_sha1
);
int
i
;
for
(
i
=
0
;
i
<
prefix_len
;
i
++
)
{
*
p
++
=
*
q
++
;
*
p
++
=
*
q
++
;
*
p
++
=
'/'
;
strbuf_addch
(
&
non_note_path
,
*
q
++
)
;
strbuf_addch
(
&
non_note_path
,
*
q
++
)
;
strbuf_addch
(
&
non_note_path
,
'/'
)
;
}
strcpy
(
p
,
entry
.
path
);
add_non_note
(
t
,
non_note_path
,
entry
.
mode
,
entry
.
sha1
);
strbuf_addstr
(
&
non_note_path
,
entry
.
path
);
add_non_note
(
t
,
strbuf_detach
(
&
non_note_path
,
NULL
),
entry
.
mode
,
entry
.
sha1
);
}
}
free
(
buf
);
...
...
sha1_file.c
浏览文件 @
f54cb059
...
...
@@ -377,15 +377,12 @@ void read_info_alternates(const char * relative_base, int depth)
char
*
map
;
size_t
mapsz
;
struct
stat
st
;
const
char
alt_file_name
[]
=
"info/alternates"
;
/* Given that relative_base is no longer than PATH_MAX,
ensure that "path" has enough space to append "/", the
file name, "info/alternates", and a trailing NUL. */
char
path
[
PATH_MAX
+
1
+
sizeof
alt_file_name
];
char
*
path
;
int
fd
;
sprintf
(
path
,
"%s/%s"
,
relative_base
,
alt_file_nam
e
);
path
=
xstrfmt
(
"%s/info/alternates"
,
relative_bas
e
);
fd
=
git_open_noatime
(
path
);
free
(
path
);
if
(
fd
<
0
)
return
;
if
(
fstat
(
fd
,
&
st
)
||
(
st
.
st_size
==
0
))
{
...
...
unpack-trees.c
浏览文件 @
f54cb059
...
...
@@ -1432,15 +1432,18 @@ static int verify_absent_1(const struct cache_entry *ce,
if
(
!
len
)
return
0
;
else
if
(
len
>
0
)
{
char
path
[
PATH_MAX
+
1
];
memcpy
(
path
,
ce
->
name
,
len
);
path
[
len
]
=
0
;
char
*
path
;
int
ret
;
path
=
xmemdupz
(
ce
->
name
,
len
);
if
(
lstat
(
path
,
&
st
))
ret
urn
error
(
"cannot stat '%s': %s"
,
path
,
ret
=
error
(
"cannot stat '%s': %s"
,
path
,
strerror
(
errno
));
return
check_ok_to_remove
(
path
,
len
,
DT_UNKNOWN
,
NULL
,
&
st
,
error_type
,
o
);
else
ret
=
check_ok_to_remove
(
path
,
len
,
DT_UNKNOWN
,
NULL
,
&
st
,
error_type
,
o
);
free
(
path
);
return
ret
;
}
else
if
(
lstat
(
ce
->
name
,
&
st
))
{
if
(
errno
!=
ENOENT
)
return
error
(
"cannot stat '%s': %s"
,
ce
->
name
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录