summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2122591)
raw | patch | inline | side by side (parent: 2122591)
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | |
Mon, 23 Apr 2007 19:26:26 +0000 (04:26 +0900) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 24 Apr 2007 07:08:01 +0000 (00:08 -0700) |
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>
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>
builtin-fetch--tool.c | patch | blob | history | |
git-fetch.sh | patch | blob | history |
diff --git a/builtin-fetch--tool.c b/builtin-fetch--tool.c
index be341c159fb17117c4cc55a8efa9e2107375a06b..3145c01f7e0e81bf28314b92737ccf2abb129dcd 100644 (file)
--- a/builtin-fetch--tool.c
+++ b/builtin-fetch--tool.c
return parse_reflist(reflist);
}
if (!strcmp("pick-rref", argv[1])) {
+ const char *ls_remote_result;
if (argc != 4)
return error("pick-rref takes 2 args");
- return pick_rref(sopt, argv[2], argv[3]);
+ ls_remote_result = argv[3];
+ if (!strcmp(ls_remote_result, "-"))
+ ls_remote_result = get_stdin();
+ return pick_rref(sopt, argv[2], ls_remote_result);
}
if (!strcmp("expand-refs-wildcard", argv[1])) {
const char *reflist;
diff --git a/git-fetch.sh b/git-fetch.sh
index 832b20cce629cb5753e849fb2a5b60ca707397a0..0e05cf1195737d2c7afc4b9447d7b4105908bf77 100755 (executable)
--- a/git-fetch.sh
+++ b/git-fetch.sh
# 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,
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 ||
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"