From 5a511574188e52137e66a73d1562ad0a1eac8067 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 21 Feb 2009 17:07:17 -0600 Subject: [PATCH] Abort if the fetch fails in setup.sh. This prevents that the push rule is added multiple times to .git/config if a fetch failed. --- setup.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 95aad80..da3e9bd 100755 --- a/setup.sh +++ b/setup.sh @@ -28,9 +28,10 @@ function git_remote_init_update() { echo "Adding remote '$2' to '$1'." git remote add -t master "$2" "$3/$1" git fetch "$2" > /dev/null - # Remove the remote if the fetch was unsuccessful. + # Remove the remote and abort if the fetch was unsuccessful. if [ "$?" -ne "0" ]; then git remote rm "$2" + exit 1 fi # Pushing to the remote pushes only the master branch in remotes named -- 2.43.2