Skip to content

Commit

Permalink
[PATCH] git-clone-script local optimization tweaks
Browse files Browse the repository at this point in the history
 - 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>
  • Loading branch information
Junio C Hamano authored and Linus Torvalds committed Jul 11, 2005
1 parent c1c774e commit ab6625e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions git-clone-script
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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=
Expand Down

0 comments on commit ab6625e

Please sign in to comment.