Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
e02cd638
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,发现更多精彩内容 >>
提交
e02cd638
编写于
11月 10, 2006
作者:
J
Junio C Hamano
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
git-cvsserver: read from git with -z to get non-ASCII pathnames.
Signed-off-by:
N
Junio C Hamano
<
junkio@cox.net
>
上级
057bc808
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
35 addition
and
28 deletion
+35
-28
git-cvsserver.perl
git-cvsserver.perl
+35
-28
未找到文件。
git-cvsserver.perl
浏览文件 @
e02cd638
...
...
@@ -2331,67 +2331,72 @@ sub update
if
(
defined
(
$
lastpicked
)
)
{
my
$
filepipe
=
open
(
FILELIST
,
'-|'
,
'git-diff-tree'
,
'-r'
,
$
lastpicked
,
$
commit
->{
hash
})
or
die
(
"Cannot call git-diff-tree : $!"
);
my
$
filepipe
=
open
(
FILELIST
,
'-|'
,
'git-diff-tree'
,
'-z'
,
'-r'
,
$
lastpicked
,
$
commit
->{
hash
})
or
die
(
"Cannot call git-diff-tree : $!"
);
local
($/)
=
"
\0"
;
while ( <FILELIST> )
{
unless
(
/^:\
d
{
6
}\
s
+\
d
{
3
}(\
d
)\
d
{
2
}\
s
+[
a
-
zA
-
Z0
-
9
]{
40
}\
s
+([
a
-
zA
-
Z0
-
9
]{
40
})\
s
+(\
w
)\
s
+(.*)$/
o
)
chomp;
unless ( /^:\d{6}\s+\d{3}(\d)\d{2}\s+[a-zA-Z0-9]{40}\s+([a-zA-Z0-9]{40})\s+(\w)$/o )
{
die("
Couldn
't process git-diff-tree line : $_");
}
my ($mode, $hash, $change) = ($1, $2, $3);
my $name = <FILELIST>;
chomp($name);
#
$
log
->
debug
(
"File mode=$
1, hash=$2, change=$3, name=$4
"
);
# $log->debug("File mode=$
mode, hash=$hash, change=$change, name=$name
");
my $git_perms = "";
$
git_perms
.=
"r"
if
(
$
1
&
4
);
$
git_perms
.=
"w"
if
(
$
1
&
2
);
$
git_perms
.=
"x"
if
(
$
1
&
1
);
$git_perms .= "r" if ( $
mode
& 4 );
$git_perms .= "w" if ( $
mode
& 2 );
$git_perms .= "x" if ( $
mode
& 1 );
$git_perms = "rw" if ( $git_perms eq "" );
if
(
$
3
eq
"D"
)
if ( $
change
eq "D" )
{
#$
log
->
debug
(
"DELETE $
4
"
);
$
head
->{$
4
}
=
{
name
=>
$
4
,
revision
=>
$
head
->{$
4
}{
revision
}
+
1
,
#$log->debug("DELETE $
name
");
$head->{$
name
} = {
name => $
name
,
revision => $head->{$
name
}{revision} + 1,
filehash => "deleted",
commithash => $commit->{hash},
modified => $commit->{date},
author => $commit->{author},
mode => $git_perms,
};
$
self
->
insert_rev
($
4
,
$
head
->{$
4
}{
revision
},
$
2
,
$
commit
->{
hash
},
$
commit
->{
date
},
$
commit
->{
author
},
$
git_perms
);
$self->insert_rev($
name, $head->{$name}{revision}, $hash
, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
}
elsif
(
$
3
eq
"M"
)
elsif ( $
change
eq "M" )
{
#$
log
->
debug
(
"MODIFIED $
4
"
);
$
head
->{$
4
}
=
{
name
=>
$
4
,
revision
=>
$
head
->{$
4
}{
revision
}
+
1
,
filehash
=>
$
2
,
#$log->debug("MODIFIED $
name
");
$head->{$
name
} = {
name => $
name
,
revision => $head->{$
name
}{revision} + 1,
filehash => $
hash
,
commithash => $commit->{hash},
modified => $commit->{date},
author => $commit->{author},
mode => $git_perms,
};
$
self
->
insert_rev
($
4
,
$
head
->{$
4
}{
revision
},
$
2
,
$
commit
->{
hash
},
$
commit
->{
date
},
$
commit
->{
author
},
$
git_perms
);
$self->insert_rev($
name, $head->{$name}{revision}, $hash
, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
}
elsif
(
$
3
eq
"A"
)
elsif ( $
change
eq "A" )
{
#$
log
->
debug
(
"ADDED $
4
"
);
$
head
->{$
4
}
=
{
name
=>
$
4
,
#$log->debug("ADDED $
name
");
$head->{$
name
} = {
name => $
name
,
revision => 1,
filehash
=>
$
2
,
filehash => $
hash
,
commithash => $commit->{hash},
modified => $commit->{date},
author => $commit->{author},
mode => $git_perms,
};
$
self
->
insert_rev
($
4
,
$
head
->{$
4
}{
revision
},
$
2
,
$
commit
->{
hash
},
$
commit
->{
date
},
$
commit
->{
author
},
$
git_perms
);
$self->insert_rev($
name, $head->{$name}{revision}, $hash
, $commit->{hash}, $commit->{date}, $commit->{author}, $git_perms);
}
else
{
$
log
->
warn
(
"UNKNOWN FILE CHANGE mode=$
1, hash=$2, change=$3, name=$4
"
);
$log->warn("UNKNOWN FILE CHANGE mode=$
mode, hash=$hash, change=$change, name=$name
");
die;
}
}
...
...
@@ -2400,10 +2405,12 @@ sub update
# this is used to detect files removed from the repo
my $seen_files = {};
my
$
filepipe
=
open
(
FILELIST
,
'-|'
,
'git-ls-tree'
,
'-r'
,
$
commit
->{
hash
})
or
die
(
"Cannot call git-ls-tree : $!"
);
my $filepipe = open(FILELIST, '
-|
', '
git
-
ls
-
tree
', '
-
z
', '
-
r
', $commit->{hash}) or die("Cannot call git-ls-tree : $!");
local $/ = "\0";
while ( <FILELIST> )
{
unless
(
/^(\
d
+)\
s
+(\
w
+)\
s
+([
a
-
zA
-
Z0
-
9
]+)\
s
+(.*)$/
o
)
chomp;
unless ( /^(\d+)\s+(\w+)\s+([a-zA-Z0-9]+)\t(.*)$/o )
{
die("Couldn'
t
process
git
-
ls
-
tree
line
:
$
_
");
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录