summaryrefslogtreecommitdiff
path: root/git-fetch.sh
diff options
context:
space:
mode:
authorOGAWA Hirofumi <hirofumi@mail.parknet.co.jp>2007-04-24 04:26:26 +0900
committerJunio C Hamano <junkio@cox.net>2007-04-24 00:08:01 -0700
commitafb5f39e24eadc5933b34cfd17c1089e482d6a6b (patch)
tree7e6476c38b936cb8f55fdeaea314ed09cf47698f /git-fetch.sh
parent2122591b3b5c6d93d3052a3151afcfa3146ede84 (diff)
downloadgit-afb5f39e24eadc5933b34cfd17c1089e482d6a6b.tar.gz
git-fetch: Fix "argument list too long"
If $ls_remote_result was too long, git-fetch--tool -s pick-rref "$rref" "$ls_remote_result" in git-fetch will fail with "argument list too long". This patch fixes git-fetch--tool and git-fetch by passing $ls_remote_result via stdin. Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-fetch.sh')
-rwxr-xr-xgit-fetch.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/git-fetch.sh b/git-fetch.sh
index 832b20cce6..0e05cf1195 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -189,8 +189,8 @@ fetch_all_at_once () {
# See if all of what we are going to fetch are
# connected to our repository's tips, in which
# case we do not have to do any fetch.
- theirs=$(git-fetch--tool -s pick-rref \
- "$rref" "$ls_remote_result") &&
+ theirs=$(echo "$ls_remote_result" | \
+ git-fetch--tool -s pick-rref "$rref" "-") &&
# This will barf when $theirs reach an object that
# we do not have in our repository. Otherwise,
@@ -198,7 +198,8 @@ fetch_all_at_once () {
git-rev-list --objects $theirs --not --all \
>/dev/null 2>/dev/null
then
- git-fetch--tool pick-rref "$rref" "$ls_remote_result"
+ echo "$ls_remote_result" | \
+ git-fetch--tool pick-rref "$rref" "-"
else
git-fetch-pack --thin $exec $keep $shallow_depth \
$quiet $no_progress "$remote" $rref ||
@@ -263,8 +264,8 @@ fetch_per_ref () {
fi
# Find $remote_name from ls-remote output.
- head=$(git-fetch--tool -s pick-rref \
- "$remote_name" "$ls_remote_result")
+ head=$(echo "$ls_remote_result" | \
+ git-fetch--tool -s pick-rref "$remote_name" "-")
expr "z$head" : "z$_x40\$" >/dev/null ||
die "No such ref $remote_name at $remote"
echo >&2 "Fetching $remote_name from $remote using $proto"