X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-fetch.sh;h=c2eebee798d10f7ed5977fc4e56cf02731031971;hb=72303d44e9d8f3fc9bef039b472a2bd259509420;hp=ee99280a2ab3abdcc340d66661747968a60c84ec;hpb=5cd060b56c3d0b9f2340377d73dfe1abbcbe8a20;p=git.git diff --git a/git-fetch.sh b/git-fetch.sh index ee99280a2..c2eebee79 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 @@ -69,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 @@ -223,9 +225,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 +244,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. @@ -347,7 +356,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