Make fetch/pull scripts terminate cleanly on errors
authorLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 7 Jun 2005 00:40:22 +0000 (17:40 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 7 Jun 2005 00:40:22 +0000 (17:40 -0700)
Don't continue with a merge if the fetch failed.

git-fetch-script
git-pull-script

index 17f22afedda0353a47bbac80d41d2908b8030f1b..7cd88b93b21c47018be7de84e7b1252d32c6098f 100755 (executable)
@@ -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
index 49f42b5ab2896356952aee9eb2b771f422011f02..a4ca97c64566419a0dc02e8e719333d1c9240edc 100755 (executable)
@@ -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)" \