summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2005-07-11 13:30:54 -0700
committerLibravatar Linus Torvalds <torvalds@g5.osdl.org>2005-07-11 14:06:57 -0700
commitab6625e06a647c4be555cadc63dfa8f0d4a7f48e (patch)
treebe14059937615c6ac4f605cb6137489707959d0d
parent[PATCH] git-cvsimport-script: add "import only" option (diff)
downloadtgif-ab6625e06a647c4be555cadc63dfa8f0d4a7f48e.tar.xz
[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: Junio C Hamano <junkio@cox.net> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rwxr-xr-xgit-clone-script11
1 files changed, 5 insertions, 6 deletions
diff --git a/git-clone-script b/git-clone-script
index 5a241fb25e..f92851ca4b 100755
--- a/git-clone-script
+++ b/git-clone-script
@@ -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=