Code

gitweb: Always display link to blobdiff_plain in git_blobdiff
[git.git] / git-fetch.sh
index 0c7a11d5658e29dcf1036afb4db4020226b8e033..c2eebee798d10f7ed5977fc4e56cf02731031971 100755 (executable)
@@ -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
 
@@ -153,7 +155,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"
@@ -354,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