Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
git
提交
10d781b9
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,发现更多精彩内容 >>
提交
10d781b9
编写于
8月 28, 2005
作者:
J
Junio C Hamano
浏览文件
操作
浏览文件
下载
差异文件
Merge refs/heads/portable from
http://www.cs.berkeley.edu/~ejr/gits/git.git
上级
928f74de
fb2af037
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
73 addition
and
38 deletion
+73
-38
apply.c
apply.c
+1
-1
cache.h
cache.h
+8
-4
commit.c
commit.c
+1
-1
connect.c
connect.c
+4
-2
daemon.c
daemon.c
+1
-0
diff.c
diff.c
+11
-8
fsck-cache.c
fsck-cache.c
+5
-2
ident.c
ident.c
+18
-8
ls-files.c
ls-files.c
+1
-1
path.c
path.c
+3
-1
pull.c
pull.c
+1
-1
receive-pack.c
receive-pack.c
+2
-2
rsh.c
rsh.c
+4
-2
server-info.c
server-info.c
+1
-1
sha1_file.c
sha1_file.c
+4
-1
ssh-pull.c
ssh-pull.c
+4
-1
ssh-push.c
ssh-push.c
+3
-1
upload-pack.c
upload-pack.c
+1
-1
未找到文件。
apply.c
浏览文件 @
10d781b9
...
...
@@ -1377,7 +1377,7 @@ static struct excludes {
static
int
use_patch
(
struct
patch
*
p
)
{
const
char
*
pathname
=
p
->
new_name
?
:
p
->
old_name
;
const
char
*
pathname
=
p
->
new_name
?
p
->
new_name
:
p
->
old_name
;
struct
excludes
*
x
=
excludes
;
while
(
x
)
{
if
(
fnmatch
(
x
->
path
,
pathname
,
0
)
==
0
)
...
...
cache.h
浏览文件 @
10d781b9
...
...
@@ -58,7 +58,11 @@
* We accept older names for now but warn.
*/
extern
char
*
gitenv_bc
(
const
char
*
);
#ifdef __GNUC__
#define gitenv(e) (getenv(e) ? : gitenv_bc(e))
#else
#define gitenv(e) (getenv(e) ? getenv(e) : gitenv_bc(e))
#endif
/*
* Basic data structures for the directory cache
...
...
@@ -100,7 +104,7 @@ struct cache_entry {
unsigned
int
ce_size
;
unsigned
char
sha1
[
20
];
unsigned
short
ce_flags
;
char
name
[
0
];
char
name
[];
};
#define CE_NAMEMASK (0x0fff)
...
...
@@ -283,7 +287,7 @@ extern int checkout_entry(struct cache_entry *ce, struct checkout *state);
extern
struct
alternate_object_database
{
struct
alternate_object_database
*
next
;
char
*
name
;
char
base
[
0
];
/* more */
char
base
[];
/* more */
}
*
alt_odb_list
;
extern
void
prepare_alt_odb
(
void
);
...
...
@@ -296,7 +300,7 @@ extern struct packed_git {
unsigned
int
pack_last_used
;
unsigned
int
pack_use_cnt
;
unsigned
char
sha1
[
20
];
char
pack_name
[
0
];
/* something like ".git/objects/pack/xxxxx.pack" */
char
pack_name
[];
/* something like ".git/objects/pack/xxxxx.pack" */
}
*
packed_git
;
struct
pack_entry
{
...
...
@@ -311,7 +315,7 @@ struct ref {
unsigned
char
new_sha1
[
20
];
unsigned
char
force
;
struct
ref
*
peer_ref
;
/* when renaming */
char
name
[
0
];
char
name
[];
};
extern
int
git_connect
(
int
fd
[
2
],
char
*
url
,
const
char
*
prog
);
...
...
commit.c
浏览文件 @
10d781b9
...
...
@@ -102,7 +102,7 @@ static unsigned long parse_commit_date(const char *buf)
static
struct
commit_graft
{
unsigned
char
sha1
[
20
];
int
nr_parent
;
unsigned
char
parent
[
0
][
20
];
/* more */
unsigned
char
parent
[][
20
];
/* more */
}
**
commit_graft
;
static
int
commit_graft_alloc
,
commit_graft_nr
;
...
...
connect.c
浏览文件 @
10d781b9
...
...
@@ -396,8 +396,10 @@ int git_connect(int fd[2], char *url, const char *prog)
close
(
pipefd
[
1
][
0
]);
close
(
pipefd
[
1
][
1
]);
if
(
protocol
==
PROTO_SSH
)
{
const
char
*
ssh
=
getenv
(
"GIT_SSH"
)
?
:
"ssh"
;
const
char
*
ssh_basename
=
strrchr
(
ssh
,
'/'
);
const
char
*
ssh
,
*
ssh_basename
;
ssh
=
getenv
(
"GIT_SSH"
);
if
(
!
ssh
)
ssh
=
"ssh"
;
ssh_basename
=
strrchr
(
ssh
,
'/'
);
if
(
!
ssh_basename
)
ssh_basename
=
ssh
;
else
...
...
daemon.c
浏览文件 @
10d781b9
...
...
@@ -3,6 +3,7 @@
#include <signal.h>
#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <netdb.h>
#include <netinet/in.h>
...
...
diff.c
浏览文件 @
10d781b9
...
...
@@ -19,6 +19,7 @@ static const char *external_diff(void)
{
static
const
char
*
external_diff_cmd
=
NULL
;
static
int
done_preparing
=
0
;
const
char
*
env_diff_opts
;
if
(
done_preparing
)
return
external_diff_cmd
;
...
...
@@ -31,11 +32,11 @@ static const char *external_diff(void)
*
* GIT_DIFF_OPTS="-c";
*/
if
(
gitenv
(
"GIT_EXTERNAL_DIFF"
))
external_diff_cmd
=
gitenv
(
"GIT_EXTERNAL_DIFF"
);
external_diff_cmd
=
gitenv
(
"GIT_EXTERNAL_DIFF"
);
/* In case external diff fails... */
diff_opts
=
gitenv
(
"GIT_DIFF_OPTS"
)
?
:
diff_opts
;
env_diff_opts
=
gitenv
(
"GIT_DIFF_OPTS"
);
if
(
env_diff_opts
)
diff_opts
=
env_diff_opts
;
done_preparing
=
1
;
return
external_diff_cmd
;
...
...
@@ -530,10 +531,12 @@ static void run_external_diff(const char *pgm,
pid_t
pid
;
int
status
;
static
int
atexit_asked
=
0
;
const
char
*
othername
;
othername
=
(
other
?
other
:
name
);
if
(
one
&&
two
)
{
prepare_temp_file
(
name
,
&
temp
[
0
],
one
);
prepare_temp_file
(
other
?
:
name
,
&
temp
[
1
],
two
);
prepare_temp_file
(
othername
,
&
temp
[
1
],
two
);
if
(
!
atexit_asked
&&
(
temp
[
0
].
name
==
temp
[
0
].
tmp_path
||
temp
[
1
].
name
==
temp
[
1
].
tmp_path
))
{
...
...
@@ -574,7 +577,7 @@ static void run_external_diff(const char *pgm,
* otherwise we use the built-in one.
*/
if
(
one
&&
two
)
builtin_diff
(
name
,
other
?
:
name
,
temp
,
xfrm_msg
,
builtin_diff
(
name
,
othername
,
temp
,
xfrm_msg
,
complete_rewrite
);
else
printf
(
"* Unmerged path %s
\n
"
,
name
);
...
...
@@ -889,13 +892,13 @@ int diff_queue_is_empty(void)
void
diff_debug_filespec
(
struct
diff_filespec
*
s
,
int
x
,
const
char
*
one
)
{
fprintf
(
stderr
,
"queue[%d] %s (%s) %s %06o %s
\n
"
,
x
,
one
?
:
""
,
x
,
one
?
one
:
""
,
s
->
path
,
DIFF_FILE_VALID
(
s
)
?
"valid"
:
"invalid"
,
s
->
mode
,
s
->
sha1_valid
?
sha1_to_hex
(
s
->
sha1
)
:
""
);
fprintf
(
stderr
,
"queue[%d] %s size %lu flags %d
\n
"
,
x
,
one
?
:
""
,
x
,
one
?
one
:
""
,
s
->
size
,
s
->
xfrm_flags
);
}
...
...
@@ -904,7 +907,7 @@ void diff_debug_filepair(const struct diff_filepair *p, int i)
diff_debug_filespec
(
p
->
one
,
i
,
"one"
);
diff_debug_filespec
(
p
->
two
,
i
,
"two"
);
fprintf
(
stderr
,
"score %d, status %c stays %d broken %d
\n
"
,
p
->
score
,
p
->
status
?
:
'?'
,
p
->
score
,
p
->
status
?
p
->
status
:
'?'
,
p
->
source_stays
,
p
->
broken_pair
);
}
...
...
fsck-cache.c
浏览文件 @
10d781b9
...
...
@@ -390,7 +390,10 @@ static int fsck_head_link(void)
char
hex
[
40
];
unsigned
char
sha1
[
20
];
static
char
path
[
PATH_MAX
],
link
[
PATH_MAX
];
const
char
*
git_dir
=
gitenv
(
GIT_DIR_ENVIRONMENT
)
?
:
DEFAULT_GIT_DIR_ENVIRONMENT
;
const
char
*
git_dir
;
git_dir
=
gitenv
(
GIT_DIR_ENVIRONMENT
);
if
(
!
git_dir
)
git_dir
=
DEFAULT_GIT_DIR_ENVIRONMENT
;
snprintf
(
path
,
sizeof
(
path
),
"%s/HEAD"
,
git_dir
);
if
(
readlink
(
path
,
link
,
sizeof
(
link
))
<
0
)
...
...
@@ -451,7 +454,7 @@ int main(int argc, char **argv)
if
(
standalone
&&
check_full
)
die
(
"Only one of --standalone or --full can be used."
);
if
(
standalone
)
unsetenv
(
"GIT_ALTERNATE_OBJECT_DIRECTORIES
"
);
putenv
(
"GIT_ALTERNATE_OBJECT_DIRECTORIES=
"
);
fsck_head_link
();
fsck_object_dir
(
get_object_directory
());
...
...
ident.c
浏览文件 @
10d781b9
...
...
@@ -58,14 +58,24 @@ static int add_raw(char *buf, int size, int offset, const char *str)
static
int
crud
(
unsigned
char
c
)
{
static
const
char
crud_array
[
256
]
=
{
[
0
...
31
]
=
1
,
[
' '
]
=
1
,
[
'.'
]
=
1
,
[
','
]
=
1
,
[
':'
]
=
1
,
[
';'
]
=
1
,
[
'<'
]
=
1
,
[
'>'
]
=
1
,
[
'"'
]
=
1
,
[
'\''
]
=
1
,
};
static
char
crud_array
[
256
];
static
int
crud_array_initialized
=
0
;
if
(
!
crud_array_initialized
)
{
int
k
;
for
(
k
=
0
;
k
<=
31
;
++
k
)
crud_array
[
k
]
=
1
;
crud_array
[
' '
]
=
1
;
crud_array
[
'.'
]
=
1
;
crud_array
[
','
]
=
1
;
crud_array
[
':'
]
=
1
;
crud_array
[
';'
]
=
1
;
crud_array
[
'<'
]
=
1
;
crud_array
[
'>'
]
=
1
;
crud_array
[
'"'
]
=
1
;
crud_array
[
'\''
]
=
1
;
crud_array_initialized
=
1
;
}
return
crud_array
[
c
];
}
...
...
ls-files.c
浏览文件 @
10d781b9
...
...
@@ -205,7 +205,7 @@ static int excluded(const char *pathname)
struct
nond_on_fs
{
int
len
;
char
name
[
0
];
char
name
[];
};
static
struct
nond_on_fs
**
dir
;
...
...
path.c
浏览文件 @
10d781b9
...
...
@@ -41,10 +41,12 @@ char *mkpath(const char *fmt, ...)
char
*
git_path
(
const
char
*
fmt
,
...)
{
const
char
*
git_dir
=
gitenv
(
GIT_DIR_ENVIRONMENT
)
?
:
DEFAULT_GIT_DIR_ENVIRONMENT
;
const
char
*
git_dir
;
va_list
args
;
unsigned
len
;
git_dir
=
gitenv
(
GIT_DIR_ENVIRONMENT
);
if
(
!
git_dir
)
git_dir
=
DEFAULT_GIT_DIR_ENVIRONMENT
;
len
=
strlen
(
git_dir
);
if
(
len
>
PATH_MAX
-
100
)
return
bad_path
;
...
...
pull.c
浏览文件 @
10d781b9
...
...
@@ -156,7 +156,7 @@ static int loop(void)
//fprintf(stderr, "fetch %s\n", sha1_to_hex(obj->sha1));
if
(
make_sure_we_have_it
(
obj
->
type
?:
"object"
,
if
(
make_sure_we_have_it
(
obj
->
type
?
obj
->
type
:
"object"
,
obj
->
sha1
))
return
-
1
;
if
(
!
obj
->
type
)
...
...
receive-pack.c
浏览文件 @
10d781b9
...
...
@@ -24,7 +24,7 @@ struct command {
unsigned
char
updated
;
unsigned
char
old_sha1
[
20
];
unsigned
char
new_sha1
[
20
];
char
ref_name
[
0
];
char
ref_name
[];
};
static
struct
command
*
commands
=
NULL
;
...
...
@@ -269,7 +269,7 @@ int main(int argc, char **argv)
/* If we have a ".git" directory, chdir to it */
chdir
(
".git"
);
setenv
(
"GIT_DIR"
,
"."
,
1
);
putenv
(
"GIT_DIR=."
);
if
(
access
(
"objects"
,
X_OK
)
<
0
||
access
(
"refs/heads"
,
X_OK
)
<
0
)
die
(
"%s doesn't appear to be a git directory"
,
dir
);
...
...
rsh.c
浏览文件 @
10d781b9
...
...
@@ -56,8 +56,10 @@ int setup_connection(int *fd_in, int *fd_out, const char *remote_prog,
return
error
(
"Couldn't create socket"
);
}
if
(
!
fork
())
{
const
char
*
ssh
=
getenv
(
"GIT_SSH"
)
?
:
"ssh"
;
const
char
*
ssh_basename
=
strrchr
(
ssh
,
'/'
);
const
char
*
ssh
,
*
ssh_basename
;
ssh
=
getenv
(
"GIT_SSH"
);
if
(
!
ssh
)
ssh
=
"ssh"
;
ssh_basename
=
strrchr
(
ssh
,
'/'
);
if
(
!
ssh_basename
)
ssh_basename
=
ssh
;
else
...
...
server-info.c
浏览文件 @
10d781b9
...
...
@@ -70,7 +70,7 @@ static struct pack_info {
int
nr_alloc
;
int
nr_heads
;
unsigned
char
(
*
head
)[
20
];
char
dep
[
0
];
/* more */
char
dep
[];
/* more */
}
**
info
;
static
int
num_pack
;
static
const
char
*
objdir
;
...
...
sha1_file.c
浏览文件 @
10d781b9
...
...
@@ -283,7 +283,10 @@ void prepare_alt_odb(void)
char
*
map
;
int
fd
;
struct
stat
st
;
char
*
alt
=
gitenv
(
ALTERNATE_DB_ENVIRONMENT
)
?
:
""
;
char
*
alt
;
alt
=
gitenv
(
ALTERNATE_DB_ENVIRONMENT
);
if
(
!
alt
)
alt
=
""
;
sprintf
(
path
,
"%s/info/alternates"
,
get_object_directory
());
if
(
alt_odb_tail
)
...
...
ssh-pull.c
浏览文件 @
10d781b9
...
...
@@ -87,7 +87,10 @@ int main(int argc, char **argv)
char
*
commit_id
;
char
*
url
;
int
arg
=
1
;
const
char
*
prog
=
getenv
(
"GIT_SSH_PUSH"
)
?
:
"git-ssh-push"
;
const
char
*
prog
;
prog
=
getenv
(
"GIT_SSH_PUSH"
);
if
(
!
prog
)
prog
=
"git-ssh-push"
;
while
(
arg
<
argc
&&
argv
[
arg
][
0
]
==
'-'
)
{
if
(
argv
[
arg
][
1
]
==
't'
)
{
...
...
ssh-push.c
浏览文件 @
10d781b9
...
...
@@ -105,10 +105,12 @@ int main(int argc, char **argv)
char
*
commit_id
;
char
*
url
;
int
fd_in
,
fd_out
;
const
char
*
prog
=
getenv
(
"GIT_SSH_PULL"
)
?
:
"git-ssh-pull"
;
const
char
*
prog
;
unsigned
char
sha1
[
20
];
char
hex
[
41
];
prog
=
getenv
(
"GIT_SSH_PULL"
);
if
(
!
prog
)
prog
=
"git-ssh-pull"
;
while
(
arg
<
argc
&&
argv
[
arg
][
0
]
==
'-'
)
{
if
(
argv
[
arg
][
1
]
==
'w'
)
arg
++
;
...
...
upload-pack.c
浏览文件 @
10d781b9
...
...
@@ -179,7 +179,7 @@ int main(int argc, char **argv)
chdir
(
".git"
);
if
(
access
(
"objects"
,
X_OK
)
||
access
(
"refs"
,
X_OK
))
die
(
"git-upload-pack: %s doesn't seem to be a git archive"
,
dir
);
setenv
(
"GIT_DIR"
,
"."
,
1
);
putenv
(
"GIT_DIR=."
);
upload_pack
();
return
0
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录