From 57a39690b936c003662b6710241732b980e58790 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 10 Jul 2006 03:34:34 -0700 Subject: fetch/clone: check return status from ls-remote Some callers of ls-remote did not check its return status. --- git-fetch.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'git-fetch.sh') diff --git a/git-fetch.sh b/git-fetch.sh index ff1769952b..0c7a11d565 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -223,9 +223,16 @@ reflist=$(get_remote_refs_for_fetch "$@") if test "$tags" then taglist=`IFS=" " && - git-ls-remote $upload_pack --tags "$remote" | + ( + git-ls-remote $upload_pack --tags "$remote" || + echo fail ouch + ) | while read sha1 name do + case "$sha1" in + fail) + exit 1 + esac case "$name" in *^*) continue ;; esac @@ -235,7 +242,7 @@ then else echo >&2 "warning: tag ${name} ignored" fi - done` + done` || exit if test "$#" -gt 1 then # remote URL plus explicit refspecs; we need to merge them. -- cgit v1.3 From 7eae7b993ec3c1f5dfeb78d79673627b48d5f772 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Fri, 14 Jul 2006 19:06:57 +0400 Subject: Fix "git-fetch --tags" exit status when nothing has been changed After commit 55b7835e1b81a6debc7648149d2b8a4c5c64ddba git-fetch --tags exits with status 1 when no tags have been changed, which breaks calling git-fetch from scripts. Signed-off-by: Sergey Vlasov Signed-off-by: Junio C Hamano --- git-fetch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'git-fetch.sh') diff --git a/git-fetch.sh b/git-fetch.sh index ff1769952b..ee99280a2a 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -153,7 +153,7 @@ fast_forward_local () { then if now_=$(cat "$GIT_DIR/$1") && test "$now_" = "$2" then - [ "$verbose" ] && echo >&2 "* $1: same as $3" + [ "$verbose" ] && echo >&2 "* $1: same as $3" ||: else echo >&2 "* $1: updating with $3" git-update-ref -m "$rloga: updating tag" "$1" "$2" -- cgit v1.3 From 482faa8dafdf5dcf207b866b9c757271d9a45301 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Mon, 17 Jul 2006 13:01:27 -0700 Subject: git-fetch: fix --keep vs --thin When --keep is specified there is no reason to pass --thin to git-fetch-pack, which are mutually exclusive. This does not hurt because fetch-pack disables thin transfer when both are given internally, but still is confusing. Signed-off-by: Junio C Hamano --- git-fetch.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'git-fetch.sh') diff --git a/git-fetch.sh b/git-fetch.sh index ee99280a2a..b6a223ee46 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -20,6 +20,7 @@ verbose= update_head_ok= exec= upload_pack= +keep=--thin while case "$#" in 0) break ;; esac do case "$1" in @@ -347,7 +348,7 @@ fetch_main () { ( : subshell because we muck with IFS IFS=" $LF" ( - git-fetch-pack $exec $keep --thin "$remote" $rref || echo failed "$remote" + git-fetch-pack $exec $keep "$remote" $rref || echo failed "$remote" ) | while read sha1 remote_name do -- cgit v1.3 From 5e27e27e5d3da5dcbe5fbfe204c2ade0128538a5 Mon Sep 17 00:00:00 2001 From: Santi Béjar Date: Sun, 23 Jul 2006 00:54:40 +0200 Subject: Defaulting fetch to origin when set in the repo-config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Santi Béjar Signed-off-by: Junio C Hamano --- git-fetch.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'git-fetch.sh') diff --git a/git-fetch.sh b/git-fetch.sh index b6a223ee46..f7167abdf0 100755 --- a/git-fetch.sh +++ b/git-fetch.sh @@ -70,7 +70,8 @@ case "$#" in 0) test -f "$GIT_DIR/branches/origin" || test -f "$GIT_DIR/remotes/origin" || - die "Where do you want to fetch from today?" + git-repo-config --get remote.origin.url >/dev/null || + die "Where do you want to fetch from today?" set origin ;; esac -- cgit v1.3