提交 ab6625e0 编写于 作者: J Junio C Hamano 提交者: Linus Torvalds

[PATCH] git-clone-script local optimization tweaks

 - When local optimization is used, the variable repo has
   already been passed through get_repo_base so there is no need
   to check for .git subdirectory in there.

 - Use cpio -l instead of "cp -l".
Signed-off-by: NJunio C Hamano <junkio@cox.net>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 c1c774e7
......@@ -48,11 +48,8 @@ test -d "$D" || usage
case "$local,$use_local" in
yes,yes)
( cd "$repo/objects" ) || {
repo="$repo/.git"
( cd "$repo/objects" ) || {
echo >&2 "-l flag seen but $repo is not local."
exit 1
}
echo >&2 "-l flag seen but $repo is not local."
exit 1
}
# See if we can hardlink and drop "l" if not.
......@@ -68,7 +65,9 @@ yes,yes)
l=l
fi &&
rm -f "$D/.git/objects/sample" &&
cp -r$l "$repo/objects" "$D/.git/" || exit 1
cd "$repo" &&
find objects -type f -print |
cpio -puamd$l "$D/.git/" || exit 1
# Make a duplicate of refs and HEAD pointer
HEAD=
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册