From b7ab75a41290728ec465f732d697f136186a4cef Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Sat, 21 Feb 2009 17:03:36 -0600 Subject: [PATCH] setup.sh removes the remote if fetching was unsuccessful. This makes fixing the remote easier as it's not necessary to remove it before trying to add it again. --- setup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.sh b/setup.sh index 8bb651c..e18d62c 100755 --- a/setup.sh +++ b/setup.sh @@ -28,6 +28,11 @@ 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. + if [ "$?" -ne "0" ]; then + git remote rm "$2" + fi + # Pushing to the remote pushes only the master branch in remotes named # the hostname of this machine. This makes it easy to see where # changes came from. -- 2.45.2