Merge branch 'jc/fetch' into next
authorJunio C Hamano <junkio@cox.net>
Fri, 17 Mar 2006 22:11:10 +0000 (14:11 -0800)
committerJunio C Hamano <junkio@cox.net>
Fri, 17 Mar 2006 22:11:10 +0000 (14:11 -0800)
* jc/fetch:
fetch: exit non-zero when fast-forward check fails.

1  2 
git-fetch.sh
diff --combined git-fetch.sh
index c0eb96752e1574b48b973acd4ebfdb81406c7bac,68356343a63b8c07def2edcbed4d3b8c06776921..954901ddce9404eeadb616c4b65b466c62d4b63f
@@@ -94,9 -94,6 +94,9 @@@ append_fetch_head () 
      # remote-nick is the URL given on the command line (or a shorthand)
      # remote-name is the $GIT_DIR relative refs/ path we computed
      # for this refspec.
 +
 +    # the $note_ variable will be fed to git-fmt-merge-msg for further
 +    # processing.
      case "$remote_name_" in
      HEAD)
        note_= ;;
      refs/tags/*)
        note_="$(expr "$remote_name_" : 'refs/tags/\(.*\)')"
        note_="tag '$note_' of " ;;
 +    refs/remotes/*)
 +      note_="$(expr "$remote_name_" : 'refs/remotes/\(.*\)')"
 +      note_="remote branch '$note_' of " ;;
      *)
        note_="$remote_name of " ;;
      esac
@@@ -153,10 -147,10 +153,10 @@@ fast_forward_local () 
        else
                echo >&2 "* $1: storing $3"
        fi
 -      git-update-ref "$1" "$2" 
 +      git-update-ref "$1" "$2"
        ;;
  
 -    refs/heads/*)
 +    refs/heads/* | refs/remotes/*)
        # $1 is the ref being updated.
        # $2 is the new value for the ref.
        local=$(git-rev-parse --verify "$1^0" 2>/dev/null)
                        ;;
                *)
                        echo >&2 "  not updating."
+                       exit 1
                        ;;
                esac
            }