projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix test case for some sed
[git.git]
/
git-clone.sh
diff --git
a/git-clone.sh
b/git-clone.sh
index
47f3ec9
..
4ed861d
100755
(executable)
--- a/
git-clone.sh
+++ b/
git-clone.sh
@@
-118,6
+118,7
@@
dir="$2"
[ -e "$dir" ] && echo "$dir already exists." && usage
mkdir -p "$dir" &&
D=$(cd "$dir" && pwd) &&
[ -e "$dir" ] && echo "$dir already exists." && usage
mkdir -p "$dir" &&
D=$(cd "$dir" && pwd) &&
+trap 'err=$?; cd ..; rm -r "$D"; exit $err' exit
case "$bare" in
yes) GIT_DIR="$D" ;;
*) GIT_DIR="$D/.git" ;;
case "$bare" in
yes) GIT_DIR="$D" ;;
*) GIT_DIR="$D/.git" ;;
@@
-153,7
+154,7
@@
yes,yes)
fi &&
rm -f "$GIT_DIR/objects/sample" &&
cd "$repo" &&
fi &&
rm -f "$GIT_DIR/objects/sample" &&
cd "$repo" &&
- find objects -depth -print | cpio -pu
a
md$l "$GIT_DIR/" || exit 1
+ find objects -depth -print | cpio -pumd$l "$GIT_DIR/" || exit 1
;;
yes)
mkdir -p "$GIT_DIR/objects/info"
;;
yes)
mkdir -p "$GIT_DIR/objects/info"
@@
-206,7
+207,13
@@
yes,yes)
fi
;;
http://*)
fi
;;
http://*)
- clone_dumb_http "$repo" "$D"
+ if test -z "@@NO_CURL@@"
+ then
+ clone_dumb_http "$repo" "$D"
+ else
+ echo >&2 "http transport not supported, rebuild Git with curl support"
+ exit 1
+ fi
;;
*)
cd "$D" && case "$upload_pack" in
;;
*)
cd "$D" && case "$upload_pack" in
@@
-246,6
+253,9
@@
Pull: $head_points_at:$origin" &&
case "$no_checkout" in
'')
case "$no_checkout" in
'')
- git
checkout
+ git
-read-tree -m -u -v HEAD HEAD
esac
fi
esac
fi
+
+trap - exit
+