From: Linus Torvalds Date: Tue, 7 Jun 2005 00:40:22 +0000 (-0700) Subject: Make fetch/pull scripts terminate cleanly on errors X-Git-Tag: v0.99~330 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ed37b5b2b94398f3ab8312dfdf23cfd25549e3ec;p=git.git Make fetch/pull scripts terminate cleanly on errors Don't continue with a merge if the fetch failed. --- diff --git a/git-fetch-script b/git-fetch-script index 17f22afed..7cd88b93b 100755 --- a/git-fetch-script +++ b/git-fetch-script @@ -35,7 +35,7 @@ download_objects () { } echo "Getting remote $merge_name" -download_one "$merge_repo/$merge_name" "$GIT_DIR"/MERGE_HEAD +download_one "$merge_repo/$merge_name" "$GIT_DIR"/MERGE_HEAD || exit 1 echo "Getting object database" -download_objects "$merge_repo" "$(cat "$GIT_DIR"/MERGE_HEAD)" +download_objects "$merge_repo" "$(cat "$GIT_DIR"/MERGE_HEAD)" || exit 1 diff --git a/git-pull-script b/git-pull-script index 49f42b5ab..a4ca97c64 100755 --- a/git-pull-script +++ b/git-pull-script @@ -15,7 +15,7 @@ fi : ${GIT_DIR=.git} : ${GIT_OBJECT_DIRECTORY="${SHA1_FILE_DIRECTORY-"$GIT_DIR/objects"}"} -git-fetch-script "$merge_repo" "$merge_head" +git-fetch-script "$merge_repo" "$merge_head" || exit 1 git-resolve-script \ "$(cat "$GIT_DIR"/HEAD)" \